diff options
author | ramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-23 09:11:37 +0000 |
---|---|---|
committer | ramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68> | 2009-06-23 09:11:37 +0000 |
commit | e74260dedbe4ba4af9d6af3d2856410fd706dc88 (patch) | |
tree | 933c3b13f11c534daaab5ef4f039957618b9cf57 /branches/sca-java-1.x/modules/implementation-spring-runtime/src | |
parent | edd87337caed8414eadd9ff03339e9d3e534be3e (diff) |
Fixes for TUSCANY-3096
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@787589 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/implementation-spring-runtime/src')
-rw-r--r-- | branches/sca-java-1.x/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java | 15 |
1 files changed, 10 insertions, 5 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 d44e4ef408..bf7d133d01 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 @@ -55,12 +55,14 @@ public class SpringContextTie { private AbstractApplicationContext springContext;
private SpringImplementationStub implementation;
+ private boolean isAnnotationSupported;
- public SpringContextTie(SpringImplementationStub implementation, URL resource) throws Exception {
+ public SpringContextTie(SpringImplementationStub implementation, URL resource, boolean annotationSupport) throws Exception {
this.implementation = implementation;
+ this.isAnnotationSupported = annotationSupport;
if ((SpringVersion.getVersion()!= null) && (! SpringVersion.getVersion().equals("2.5.5"))) {
throw new RuntimeException("Unsupported version: Use only Spring Framework Version 2.5.5");
- }
+ }
SCAParentApplicationContext scaParentContext = new SCAParentApplicationContext(implementation);
springContext = createApplicationContext(scaParentContext, resource);
}
@@ -120,19 +122,22 @@ public class SpringContextTie { if (beanClassName.indexOf(".ClassPathXmlApplicationContext") != -1) {
appContext = new ClassPathXmlApplicationContext(listValues, false, scaParentContext);
appContext.refresh();
- includeAnnotationProcessors(appContext.getBeanFactory());
+ if (isAnnotationSupported)
+ includeAnnotationProcessors(appContext.getBeanFactory());
return appContext;
} else {
appContext = new FileSystemXmlApplicationContext(listValues, false, scaParentContext);
appContext.refresh();
- includeAnnotationProcessors(appContext.getBeanFactory());
+ if (isAnnotationSupported)
+ includeAnnotationProcessors(appContext.getBeanFactory());
return appContext;
}
}
}
// use the generic application context as default
- includeAnnotationProcessors(beanFactory);
+ if (isAnnotationSupported)
+ includeAnnotationProcessors(beanFactory);
appContext = new GenericApplicationContext(beanFactory, scaParentContext);
return appContext;
}
|