diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-21 20:28:20 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-21 20:28:20 +0000 |
commit | b8a63636ff2dbea555f14b42c5a49e1555e68f85 (patch) | |
tree | a9cc56e976bbcc2b2e352dcc9f2844a205c38270 /sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany | |
parent | 9158de4b937e44c15edd966e37774d717e506eb6 (diff) |
Allow the spring component to receive parent application context from the composite context
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1083938 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany')
2 files changed, 4 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SpringApplicationContextAccessor.java b/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SpringApplicationContextAccessor.java index 2d18b5aa6c..f4820ea9a0 100644 --- a/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SpringApplicationContextAccessor.java +++ b/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SpringApplicationContextAccessor.java @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.implementation.spring.context; +import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.springframework.context.ApplicationContext; /** @@ -28,14 +29,9 @@ public interface SpringApplicationContextAccessor { /** * Get the parent Spring application context for the hosting environment. This will be used as the parent * application context for implementation.spring components + * @param component The Spring component instance * @return The parent application context */ - ApplicationContext getParentApplicationContext(); + ApplicationContext getParentApplicationContext(RuntimeComponent component); - /** - * Set the root Spring application context. This is particually useful for Spring web integration where Spring - * creates WebApplicationContext and keeps it in the ServletContext - * @param parentApplicationContext The parent application context - */ - void setParentApplicationContext(ApplicationContext parentApplicationContext); } diff --git a/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProviderFactory.java b/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProviderFactory.java index be16fb3251..ad395323c5 100644 --- a/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProviderFactory.java +++ b/sca-java-2.x/trunk/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProviderFactory.java @@ -62,7 +62,7 @@ public class SpringImplementationProviderFactory implements ImplementationProvid public ImplementationProvider createImplementationProvider(RuntimeComponent component, SpringImplementation implementation) { ApplicationContext parentApplicationContext = - (contextAccessor != null) ? contextAccessor.getParentApplicationContext() : null; + (contextAccessor != null) ? contextAccessor.getParentApplicationContext(component) : null; SpringImplementationWrapper tie = new SpringImplementationWrapper(implementation, parentApplicationContext, component, propertyFactory); return new SpringImplementationProvider(component, tie, parentApplicationContext, proxyFactory, propertyFactory); |