summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/implementation-web-runtime/src
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/implementation-web-runtime/src')
-rw-r--r--sca-java-2.x/trunk/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java b/sca-java-2.x/trunk/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
index 3dcdd66d77..468c9a78b8 100644
--- a/sca-java-2.x/trunk/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
+++ b/sca-java-2.x/trunk/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
@@ -21,8 +21,10 @@ package org.apache.tuscany.sca.implementation.web.runtime;
import java.util.List;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.host.http.DefaultServletHostExtensionPoint;
import org.apache.tuscany.sca.host.http.ServletHost;
import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
+import org.apache.tuscany.sca.host.webapp.WebAppServletHost;
import org.apache.tuscany.sca.implementation.web.WebImplementation;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.Invoker;
@@ -39,8 +41,14 @@ public class WebImplementationProviderFactory implements ImplementationProviderF
public WebImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
List<ServletHost> hosts = servletHosts.getServletHosts();
- if (!hosts.isEmpty()) {
- this.servletHost = hosts.get(0);
+ for (ServletHost servletHost : hosts) {
+ if ("webapp".equals(servletHost.getName())) {
+ if(servletHost instanceof DefaultServletHostExtensionPoint.LazyServletHost) {
+ this.servletHost = ((DefaultServletHostExtensionPoint.LazyServletHost) servletHost).getServletHost();
+ } else if(servletHost instanceof WebAppServletHost) {
+ this.servletHost = (WebAppServletHost) servletHost;
+ }
+ }
}
jsClient = extensionPoints.getExtensionPoint(ClientExtensionPoint.class);