summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
+ }
}
}