summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-02-26 12:16:20 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-02-26 12:16:20 +0000
commit60bc3fda9aaed67c76535ea34521397e327f098d (patch)
tree050cafe44cf50499c6d3657654bd1a7fb0546767 /java
parent5c8ed9b1f9f737b4a22b3b7ef3901b7ff58512bb (diff)
Chnage Jetty host to make itself default if multiple hosts registered so that in standalone runtime environment jetty is used even if webapp host in the classpath
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@748108 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java b/java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java
index 31c8397f8b..dde99a1fac 100644
--- a/java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java
+++ b/java/sca/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyRuntimeModuleActivator.java
@@ -21,12 +21,14 @@ package org.apache.tuscany.sca.http.jetty;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.ModuleActivator;
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.host.http.ServletHost;
import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
import org.apache.tuscany.sca.work.WorkScheduler;
@@ -43,8 +45,11 @@ public class JettyRuntimeModuleActivator implements ModuleActivator {
// Register a Jetty Servlet host
ServletHostExtensionPoint servletHosts =
extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class);
-
- if (servletHosts.getServletHosts().size() < 1) {
+
+ List<ServletHost> hosts = servletHosts.getServletHosts();
+ if (hosts != null) {
+ // Clear out any other hosts (eg webapp or tomcat) and add this jetty host is default
+ hosts.clear();
UtilityExtensionPoint utilities = extensionPointRegistry.getExtensionPoint(UtilityExtensionPoint.class);
final WorkScheduler workScheduler = utilities.getUtility(WorkScheduler.class);
// Allow privileged access to start MBeans. Requires MBeanPermission in security policy.