From 49b150906d545f9109ca321bcda445f9c998d23a Mon Sep 17 00:00:00 2001 From: antelder Date: Mon, 11 Jan 2010 18:04:18 +0000 Subject: Use the servlethost helper to locate the servlet host git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@897972 13f79535-47bb-0310-9956-ffa450edef68 --- .../web/runtime/WebImplementationProviderFactory.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 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 468c9a78b8..d020dbe51f 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 @@ -24,6 +24,7 @@ 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.http.ServletHostHelper; import org.apache.tuscany.sca.host.webapp.WebAppServletHost; import org.apache.tuscany.sca.implementation.web.WebImplementation; import org.apache.tuscany.sca.interfacedef.Operation; @@ -39,18 +40,7 @@ public class WebImplementationProviderFactory implements ImplementationProviderF private ClientExtensionPoint jsClient; public WebImplementationProviderFactory(ExtensionPointRegistry extensionPoints) { - ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class); - List hosts = servletHosts.getServletHosts(); - 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; - } - } - } - + this.servletHost = ServletHostHelper.getServletHost(extensionPoints); jsClient = extensionPoints.getExtensionPoint(ClientExtensionPoint.class); } -- cgit v1.2.3