diff options
2 files changed, 8 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAGenericApplicationContext.java b/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAGenericApplicationContext.java index 44a3ee2b88..35524bb6ec 100644 --- a/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAGenericApplicationContext.java +++ b/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAGenericApplicationContext.java @@ -31,6 +31,7 @@ import org.apache.tuscany.sca.implementation.spring.SpringSCAReferenceElement; import org.apache.tuscany.sca.implementation.spring.SpringSCAServiceElement; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyValue; +import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanReference; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; @@ -61,6 +62,13 @@ public class SCAGenericApplicationContext extends GenericApplicationContext { this.classloader = classloader; } + /** + * Force the parent bean factory to be the SCA parent context itself + */ + protected BeanFactory getInternalParentBeanFactory() { + return getParent(); + } + @Override protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) { beanFactory.setBeanClassLoader(classloader); diff --git a/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAParentApplicationContext.java b/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAParentApplicationContext.java index 2829891c52..654d0c6954 100644 --- a/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAParentApplicationContext.java +++ b/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAParentApplicationContext.java @@ -60,12 +60,6 @@ public class SCAParentApplicationContext extends GenericApplicationContext imple this.implementation = implementation; } // end constructor - - protected BeanFactory getInternalParentBeanFactory() { - // Disable the parent delegation as we'll handle it inside the getBean() - return null; - } - public Object getBean(String name) throws BeansException { return getBean(name, (Class)null); } |