summaryrefslogtreecommitdiffstats
path: root/java/sca/distribution/tomcat/tomcat-hook
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-25 07:22:52 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-25 07:22:52 +0000
commitef44ca3f86fd020591961d9c94ccd7937fce8749 (patch)
treeac22dbf759eb38fd371bb8a138f4e902c10c4257 /java/sca/distribution/tomcat/tomcat-hook
parent57d6aa694a8dce102536e63bdb79161bca8e8cf6 (diff)
Remove code for SCA version to keep things simple for now
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@778319 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/distribution/tomcat/tomcat-hook')
-rw-r--r--java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java b/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java
index 0d6404fff9..f6aa2203e7 100644
--- a/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java
+++ b/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java
@@ -39,33 +39,32 @@ public class TuscanyStandardContext extends StandardContext {
return loader;
}
- initTuscany();
+ if (isSCAAlication()) {
+ initTuscany();
+ }
return super.getLoader();
}
private void initTuscany() {
- String scaVersion = getSCAVersion();
- if ("1.1".equals(scaVersion)) {
- setParentClassLoader(getTuscanyClassloader(scaVersion));
- addApplicationListener("org.apache.tuscany.sca.host.webapp.TuscanyContextListener");
- FilterDef filterDef = new FilterDef();
- filterDef.setFilterName("TuscanyFilter");
- filterDef.setFilterClass("org.apache.tuscany.sca.host.webapp.TuscanyServletFilter");
- addFilterDef(filterDef);
- }
+ setParentClassLoader(getTuscanyClassloader());
+ addApplicationListener("org.apache.tuscany.sca.host.webapp.TuscanyContextListener");
+ FilterDef filterDef = new FilterDef();
+ filterDef.setFilterName("TuscanyFilter");
+ filterDef.setFilterClass("org.apache.tuscany.sca.host.webapp.TuscanyServletFilter");
+ addFilterDef(filterDef);
}
- private String getSCAVersion() {
+ private boolean isSCAAlication() {
Object o = null;
try {
o = getResources().lookup("WEB-INF/web.composite");
} catch (NamingException e) {
}
- return o != null ? "1.1" : null;
+ return o != null;
}
- private ClassLoader getTuscanyClassloader(String version) {
+ private ClassLoader getTuscanyClassloader() {
if (tuscanyClassLoader == null) {
File tuscanyWar = new File(System.getProperty("org.apache.tuscany.sca.tomcat.war"));
File[] runtimeJars = new File(tuscanyWar, "tuscany-lib").listFiles();