summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/implementation-web-runtime/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-07 09:48:34 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-07 09:48:34 +0000
commit408ca620083f888c782da16cdcf047605860dc90 (patch)
tree8e12e722b57e8b52d913d5a3acd946860c53e2df /sca-java-2.x/trunk/modules/implementation-web-runtime/src
parent440413e4c6e222f25aea07526a49e037368f8180 (diff)
Update to the servlet host locating code
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@896824 13f79535-47bb-0310-9956-ffa450edef68
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);