summaryrefslogtreecommitdiffstats
path: root/java/sca/distribution/tomcat/tomcat-hook
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-29 09:42:53 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-29 09:42:53 +0000
commit5fe2b172caeeb5743da06868a28ffc882f3b6db2 (patch)
tree1630eeaf17753fedc92fac12e2bc523682250c24 /java/sca/distribution/tomcat/tomcat-hook
parent0ff5b1526032147746a2f43b9463e791e115b872 (diff)
Start adding support for non-webapp contributions. The idea being to enable using regular SCA contribution jas/zips/folders as well as webapps and have them all in the same sca domain and wiring between each other. None of the domain works yet as we need to make more progress on the dynamic doamin discussion. Eventually the non-webapp contributions would use the tomcat host config facilities so support hot deployment, and there'd be some domain management panels in the tuscany webapp to view and modify the domain. Could potentially have multiple domains within a tomcat instance though lets leave that for now as it adds some complications. Would also be good to get the SCAClient API able to talk to the tomcat domain so JSE clients can call sca services in tomcat
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@779906 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.java13
1 files changed, 11 insertions, 2 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 5757c13206..d5622bc396 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
@@ -45,6 +45,7 @@ public class TuscanyStandardContext extends StandardContext {
protected static final String TUSCANY_FILTER_NAME = "TuscanyFilter";
protected static final String TUSCANY_SERVLET_FILTER = "org.apache.tuscany.sca.host.webapp.TuscanyServletFilter";
protected static final String TUSCANY_CONTEXT_LISTENER = "org.apache.tuscany.sca.host.webapp.TuscanyContextListener";
+ protected static final String TUSCANY_MANAGER_LISTENER = "org.apache.tuscany.sca.tomcat.foo.TuscanyTomcatNode";
private boolean isSCAApp;
@@ -65,7 +66,7 @@ public class TuscanyStandardContext extends StandardContext {
}
ClassLoader parent = getParentClassLoader();
- if (isSCAApp = isSCAApplication()) {
+ if (isSCAApp = isSCAApplication() || isTuscanyManager()) {
String sharedProp = System.getProperty(TuscanyLifecycleListener.TUSCANY_SHARED_PROP, "false");
boolean shared = "true".equalsIgnoreCase(sharedProp);
if (!shared) {
@@ -81,7 +82,11 @@ public class TuscanyStandardContext extends StandardContext {
@Override
public boolean listenerStart() {
- if (isSCAApp) {
+ if (isTuscanyManager()) {
+ // this isn't great having the manager app config scattered about different modules
+ // but is temp until this is all tidied up in a refactor after the basics are working
+ addApplicationListener(TUSCANY_MANAGER_LISTENER);
+ } else if (isSCAApp) {
enableTuscany();
}
return super.listenerStart();
@@ -151,6 +156,10 @@ public class TuscanyStandardContext extends StandardContext {
return true;
}
+ private boolean isTuscanyManager() {
+ return "/tuscany".equals(getName());
+ }
+
private static URLClassLoader copy(URLClassLoader classLoader) {
return new URLClassLoader(classLoader.getURLs(), classLoader.getParent());
}