summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
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.