summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-01 14:47:04 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-01 14:47:04 +0000
commitaf5c73666e4902db9bf7262143c558ee91410d27 (patch)
tree3bde376b625587ccae5642f12bf8dce758c04f74 /java
parent4e695e520ba966d5d004d24d1f7b16140d02605e (diff)
Start bringing up the spring annotation support
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@770699 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java12
-rw-r--r--java/sca/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java23
2 files changed, 29 insertions, 6 deletions
diff --git a/java/sca/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java b/java/sca/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
index b12a851dec..33345c698e 100644
--- a/java/sca/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
+++ b/java/sca/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
@@ -146,15 +146,15 @@ public class SpringContextTie {
BeanPostProcessor initDestroyProcessor = new InitDestroyAnnotationProcessor();
beanFactory.addBeanPostProcessor(initDestroyProcessor);
- ComponentStub component = null; //TODO
// Processor to deal with @Reference SCA Annotations
-// BeanPostProcessor referenceProcessor = new ReferenceAnnotationProcessor(component);
-// beanFactory.addBeanPostProcessor(referenceProcessor);
+ ComponentStub component = new ComponentStub(implementation.getComponentStub());
+ BeanPostProcessor referenceProcessor = new ReferenceAnnotationProcessor(component);
+ beanFactory.addBeanPostProcessor(referenceProcessor);
- PropertyValueStub pvs = null; //TODO
// Processor to deal with @Property SCA Annotations
-// BeanPostProcessor propertyProcessor = new PropertyAnnotationProcessor(pvs);
-// beanFactory.addBeanPostProcessor(propertyProcessor);
+ PropertyValueStub pvs = new PropertyValueStub(implementation.getPropertyValueStub());
+ BeanPostProcessor propertyProcessor = new PropertyAnnotationProcessor(pvs);
+ beanFactory.addBeanPostProcessor(propertyProcessor);
// Processor to deal with @ComponentName SCA Annotations
BeanPostProcessor componentNameProcessor = new ComponentNameAnnotationProcessor(implementation.getComponentName());
diff --git a/java/sca/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java b/java/sca/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java
index 57948938e3..c3ac082c4c 100644
--- a/java/sca/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java
+++ b/java/sca/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java
@@ -37,6 +37,8 @@ public class SpringImplementationStub {
Method getURI;
Method getBean;
Method getComponentName;
+ Method getComponentStub;
+ Method getPropertyValueStub;
public SpringImplementationStub(Object tie) {
this.tie = tie;
@@ -45,6 +47,8 @@ public class SpringImplementationStub {
getURI = tieClass.getMethod("getURI", new Class<?>[]{});
getBean = tieClass.getMethod("getBean", new Class<?>[]{String.class, Class.class});
getComponentName = tieClass.getMethod("getComponentName");
+ getComponentStub = tieClass.getMethod("getComponentStub");
+ getPropertyValueStub = tieClass.getMethod("getPropertyValueStub");
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -89,6 +93,25 @@ public class SpringImplementationStub {
} catch (Exception e) {
throw new RuntimeException(e);
}
+ }
+
+ public Object getComponentStub() {
+ try {
+
+ return (String)getComponentStub.invoke(tie);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getPropertyValueStub() {
+ try {
+
+ return (String)getPropertyValueStub.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
}
}