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 | |
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')
4 files changed, 18 insertions, 22 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-spring-runtime/META-INF/MANIFEST.MF b/sca-java-2.x/trunk/modules/implementation-spring-runtime/META-INF/MANIFEST.MF index b598607625..ea7eacc49c 100644 --- a/sca-java-2.x/trunk/modules/implementation-spring-runtime/META-INF/MANIFEST.MF +++ b/sca-java-2.x/trunk/modules/implementation-spring-runtime/META-INF/MANIFEST.MF @@ -40,17 +40,17 @@ Import-Package: org.oasisopen.sca;version="2.0.0", org.apache.tuscany.sca.policy;version="2.0.0",
org.apache.tuscany.sca.provider;version="2.0.0",
org.apache.tuscany.sca.runtime;version="2.0.0",
- org.springframework.beans;version="3.0.2.RELEASE",
- org.springframework.beans.factory;version="3.0.2.RELEASE",
- org.springframework.beans.factory.annotation;version="3.0.2.RELEASE",
- org.springframework.beans.factory.config;version="3.0.2.RELEASE",
- org.springframework.beans.factory.support;version="3.0.2.RELEASE",
- org.springframework.beans.factory.xml;version="3.0.2.RELEASE",
- org.springframework.context;version="3.0.2.RELEASE",
- org.springframework.context.support;version="3.0.2.RELEASE",
- org.springframework.core;version="3.0.2.RELEASE",
- org.springframework.core.io;version="3.0.2.RELEASE",
- org.springframework.util;version="3.0.2.RELEASE"
+ org.springframework.beans,
+ org.springframework.beans.factory,
+ org.springframework.beans.factory.annotation,
+ org.springframework.beans.factory.config,
+ org.springframework.beans.factory.support,
+ org.springframework.beans.factory.xml,
+ org.springframework.context,
+ org.springframework.context.support,
+ org.springframework.core,
+ org.springframework.core.io,
+ org.springframework.util
Export-Package: org.apache.tuscany.sca.implementation.spring.context;version="2.0.0";
uses:="org.springframework.beans.factory.support,
org.springframework.context.support,
diff --git a/sca-java-2.x/trunk/modules/implementation-spring-runtime/pom.xml b/sca-java-2.x/trunk/modules/implementation-spring-runtime/pom.xml index 45e236acd9..a40a0ff393 100644 --- a/sca-java-2.x/trunk/modules/implementation-spring-runtime/pom.xml +++ b/sca-java-2.x/trunk/modules/implementation-spring-runtime/pom.xml @@ -42,19 +42,19 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> - <version>3.0.2.RELEASE</version> + <version>3.0.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> - <version>3.0.2.RELEASE</version> + <version>3.0.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> - <version>3.0.2.RELEASE</version> + <version>3.0.5.RELEASE</version> </dependency> </dependencies> 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); |