summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
diff options
context:
space:
mode:
authorramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2009-07-03 10:48:57 +0000
committerramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2009-07-03 10:48:57 +0000
commiteec6912ddff319e4992a19064c470a4fdad1542b (patch)
tree12c475e70c205b7892df76a0e1ff0ba7c16b7695 /branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
parent4304fe60d1b2ab465f486c0a93c1e7d9761757ed (diff)
Updated fixes for TUSCANY-3069
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@790853 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java')
-rw-r--r--branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java40
1 files changed, 18 insertions, 22 deletions
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 f250db1631..5961c52cc4 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,7 +38,6 @@ 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;
@@ -103,33 +102,30 @@ public class SpringContextTie {
if (beanClassName.indexOf(".ClassPathXmlApplicationContext") != -1) {
BeanDefinition beanDef = beanFactory.getBeanDefinition(bean);
- String[] listValues = null;
+ String[] configLocations = null;
List<ConstructorArgumentValues.ValueHolder> conArgs =
beanDef.getConstructorArgumentValues().getGenericArgumentValues();
for (ConstructorArgumentValues.ValueHolder conArg : conArgs) {
- if (conArg.getValue() instanceof TypedStringValue) {
- TypedStringValue value = (TypedStringValue) conArg.getValue();
- if (value.getValue().indexOf(".xml") != -1)
- listValues = new String[]{value.getValue()};
- }
- if (conArg.getValue() instanceof ManagedList) {
- Iterator itml = ((ManagedList)conArg.getValue()).iterator();
- StringBuffer values = new StringBuffer();
- while (itml.hasNext()) {
- TypedStringValue next = (TypedStringValue)itml.next();
- if (next.getValue().indexOf(".xml") != -1) {
- values.append(next.getValue());
- values.append("~");
- }
- }
- listValues = (values.toString()).split("~");
+ if (conArg.getValue() instanceof TypedStringValue) {
+ TypedStringValue value = (TypedStringValue) conArg.getValue();
+ if (value.getValue().indexOf(".xml") != -1)
+ configLocations = new String[]{value.getValue()};
+ }
+ if (conArg.getValue() instanceof ManagedList) {
+ Iterator itml = ((ManagedList)conArg.getValue()).iterator();
+ StringBuffer values = new StringBuffer();
+ while (itml.hasNext()) {
+ TypedStringValue next = (TypedStringValue)itml.next();
+ if (next.getValue().indexOf(".xml") != -1) {
+ values.append(implementation.getClassLoader().getResource(next.getValue()).toString());
+ values.append("~");
+ }
}
+ configLocations = (values.toString()).split("~");
+ }
}
- appContext = new ClassPathXmlApplicationContext(listValues, false, scaParentContext);
- appContext.setClassLoader(implementation.getClassLoader());
- appContext.refresh();
- //appContext.getBeanFactory().setBeanClassLoader(implementation.getClassLoader());
+ appContext = new ClassPathXmlApplicationContext(configLocations, true, scaParentContext);
if (isAnnotationSupported)
includeAnnotationProcessors(appContext.getBeanFactory());
return appContext;