From a58905ee30aa63707ddc0e2e7d0b5747936a6594 Mon Sep 17 00:00:00 2001 From: rfeng Date: Fri, 16 Nov 2012 06:50:58 +0000 Subject: Fix the spring delegation git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1410212 13f79535-47bb-0310-9956-ffa450edef68 --- .../spring/context/SCAGenericApplicationContext.java | 8 ++++++++ .../spring/context/SCAParentApplicationContext.java | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'sca-java-2.x') 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); } -- cgit v1.2.3