summaryrefslogtreecommitdiffstats
path: root/branches
diff options
context:
space:
mode:
authorramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2009-07-02 17:08:20 +0000
committerramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2009-07-02 17:08:20 +0000
commit5ea89068b364bb03a12d4311d05ff9c91d378b7c (patch)
tree48d8c9ae261eed195409495573bc443e4b586d2e /branches
parentec4ca248e6e7cb5107f6e30e793391d1b43ba479 (diff)
Updated fixes for TUSCANY-3069
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@790682 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches')
-rw-r--r--branches/sca-java-1.x/itest/spring/src/main/resources/context/multiple/META-INF/spring/StockQuoteService-context.xml3
-rw-r--r--branches/sca-java-1.x/itest/spring/src/main/resources/context/multiple/META-INF/spring/beanRefContext.xml6
-rw-r--r--branches/sca-java-1.x/itest/spring/src/test/java/context/multiple/StockQuoteServer.java7
-rw-r--r--branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java14
4 files changed, 12 insertions, 18 deletions
diff --git a/branches/sca-java-1.x/itest/spring/src/main/resources/context/multiple/META-INF/spring/StockQuoteService-context.xml b/branches/sca-java-1.x/itest/spring/src/main/resources/context/multiple/META-INF/spring/StockQuoteService-context.xml
index 74473073ea..0b8ee44e85 100644
--- a/branches/sca-java-1.x/itest/spring/src/main/resources/context/multiple/META-INF/spring/StockQuoteService-context.xml
+++ b/branches/sca-java-1.x/itest/spring/src/main/resources/context/multiple/META-INF/spring/StockQuoteService-context.xml
@@ -29,8 +29,5 @@
<bean id="StockQuoteServiceBean" class="bigbank.stockquote.StockQuoteImpl">
</bean>
-
- <bean id="applicationContextProvider" class="context.access.SCAApplicationContextProvider">
- </bean>
</beans> \ No newline at end of file
diff --git a/branches/sca-java-1.x/itest/spring/src/main/resources/context/multiple/META-INF/spring/beanRefContext.xml b/branches/sca-java-1.x/itest/spring/src/main/resources/context/multiple/META-INF/spring/beanRefContext.xml
index 8d86820d44..f547b179ef 100644
--- a/branches/sca-java-1.x/itest/spring/src/main/resources/context/multiple/META-INF/spring/beanRefContext.xml
+++ b/branches/sca-java-1.x/itest/spring/src/main/resources/context/multiple/META-INF/spring/beanRefContext.xml
@@ -26,9 +26,9 @@
<bean id="beanRefFactory" class="org.springframework.context.support.ClassPathXmlApplicationContext">
<constructor-arg>
- <list>
- <value>context/multiple/META-INF/spring/StockQuoteService-context.xml</value>
- <value>context/multiple/META-INF/spring/SpringHelloWorld-context.xml</value>
+ <list>
+ <value>META-INF/spring/SpringHelloWorld-context.xml</value>
+ <value>META-INF/spring/StockQuoteService-context.xml</value>
</list>
</constructor-arg>
</bean>
diff --git a/branches/sca-java-1.x/itest/spring/src/test/java/context/multiple/StockQuoteServer.java b/branches/sca-java-1.x/itest/spring/src/test/java/context/multiple/StockQuoteServer.java
index 0f4d9f7c42..18c7ca6a74 100644
--- a/branches/sca-java-1.x/itest/spring/src/test/java/context/multiple/StockQuoteServer.java
+++ b/branches/sca-java-1.x/itest/spring/src/test/java/context/multiple/StockQuoteServer.java
@@ -39,12 +39,7 @@ public class StockQuoteServer {
SCANodeFactory factory = SCANodeFactory.newInstance();
SCANode node = factory.createSCANode(new File("src/main/resources/context/multiple/StockQuote.composite").toURL().toString(),
new SCAContribution("TestContribution", new File("src/main/resources/context/multiple/").toURL().toString()));
- node.start();
-
- // Method 1: To access the Spring Application Context instance
- ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
- if (ctx.containsBean("StockQuoteServiceBean"))
- System.out.println("StockQuoteServiceBean is now available for use...");
+ node.start();
System.out.println("Press Enter to Exit...");
Thread.sleep(1000);
diff --git a/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java b/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
index 94556eae57..f250db1631 100644
--- a/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
+++ b/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
@@ -38,6 +38,7 @@ import org.springframework.beans.factory.config.ConstructorArgumentValues;
import org.springframework.beans.factory.config.TypedStringValue;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.XmlBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
@@ -70,7 +71,8 @@ public class SpringContextTie {
}
public void start() {
- // Do refresh here to ensure that Spring Beans are not touched before the SCA config process is complete...
+ // Do refresh here to ensure that Spring Beans are not touched before
+ // the SCA config process is complete...
springContext.refresh();
springContext.start();
}
@@ -122,11 +124,12 @@ public class SpringContextTie {
}
listValues = (values.toString()).split("~");
}
- }
-
- appContext = new ClassPathXmlApplicationContext(listValues, false, scaParentContext);
+ }
+
+ appContext = new ClassPathXmlApplicationContext(listValues, false, scaParentContext);
+ appContext.setClassLoader(implementation.getClassLoader());
appContext.refresh();
- appContext.getBeanFactory().setBeanClassLoader(implementation.getClassLoader());
+ //appContext.getBeanFactory().setBeanClassLoader(implementation.getClassLoader());
if (isAnnotationSupported)
includeAnnotationProcessors(appContext.getBeanFactory());
return appContext;
@@ -137,7 +140,6 @@ public class SpringContextTie {
if (isAnnotationSupported)
includeAnnotationProcessors(beanFactory);
appContext = new GenericApplicationContext(beanFactory, scaParentContext);
- appContext.setClassLoader(implementation.getClassLoader());
return appContext;
}