diff options
Diffstat (limited to 'java/sca/modules/implementation-spring-runtime')
2 files changed, 15 insertions, 17 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 33345c698e..77a8c245d7 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 @@ -30,6 +30,7 @@ import org.apache.tuscany.sca.implementation.spring.processor.InitDestroyAnnotat import org.apache.tuscany.sca.implementation.spring.processor.PropertyAnnotationProcessor;
import org.apache.tuscany.sca.implementation.spring.processor.PropertyValueStub;
import org.apache.tuscany.sca.implementation.spring.processor.ReferenceAnnotationProcessor;
+import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
@@ -55,9 +56,9 @@ public class SpringContextTie { private SpringImplementationStub implementation;
public SpringContextTie(SpringImplementationStub implementation, URL resource) {
+ this.implementation = implementation;
SCAParentApplicationContext scaParentContext = new SCAParentApplicationContext(implementation);
springContext = createApplicationContext(scaParentContext, resource);
- this.implementation = implementation;
}
public void start() {
@@ -130,12 +131,9 @@ public class SpringContextTie { return appContext;
}
-// public Object getBean(String id) throws SpringInvocationException {
-// try {
-// return springContext.getBean(beanElement.getId());
-// } catch (BeansException e) {
-// throw new SpringInvocationException(e);
-// }
+ public Object getBean(String id) throws BeansException {
+ return springContext.getBean(id);
+ }
/**
* Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
@@ -147,12 +145,12 @@ public class SpringContextTie { beanFactory.addBeanPostProcessor(initDestroyProcessor);
// Processor to deal with @Reference SCA Annotations
- ComponentStub component = new ComponentStub(implementation.getComponentStub());
+ ComponentStub component = new ComponentStub(implementation.getComponentTie());
BeanPostProcessor referenceProcessor = new ReferenceAnnotationProcessor(component);
beanFactory.addBeanPostProcessor(referenceProcessor);
// Processor to deal with @Property SCA Annotations
- PropertyValueStub pvs = new PropertyValueStub(implementation.getPropertyValueStub());
+ PropertyValueStub pvs = new PropertyValueStub(implementation.getPropertyValueTie());
BeanPostProcessor propertyProcessor = new PropertyAnnotationProcessor(pvs);
beanFactory.addBeanPostProcessor(propertyProcessor);
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 c3ac082c4c..3139c9c500 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,8 +37,8 @@ public class SpringImplementationStub { Method getURI;
Method getBean;
Method getComponentName;
- Method getComponentStub;
- Method getPropertyValueStub;
+ Method getComponentTie;
+ Method getPropertyValueTie;
public SpringImplementationStub(Object tie) {
this.tie = tie;
@@ -47,8 +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");
+ getComponentTie = tieClass.getMethod("getComponentTie");
+ getPropertyValueTie = tieClass.getMethod("getPropertyValueTie");
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -95,20 +95,20 @@ public class SpringImplementationStub { }
}
- public Object getComponentStub() {
+ public Object getComponentTie() {
try {
- return (String)getComponentStub.invoke(tie);
+ return getComponentTie.invoke(tie);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
- public Object getPropertyValueStub() {
+ public Object getPropertyValueTie() {
try {
- return (String)getPropertyValueStub.invoke(tie);
+ return getPropertyValueTie.invoke(tie);
} catch (Exception e) {
throw new RuntimeException(e);
|