summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostHelper.java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-14 00:50:38 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-14 00:50:38 +0000
commitb4f48f407a8fefba16395eceb34de6bd48e74d12 (patch)
tree7e1bcf4456ef1dfd3b4d337ed7ea262f1259ffef /sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostHelper.java
parent014971ccb5b2041147cf9d84d498cce64ea0493e (diff)
Improve the IP address binding to be based on the host from the uri
Having servlet host to return deployed uri git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@922701 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostHelper.java')
-rw-r--r--sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostHelper.java28
1 files changed, 3 insertions, 25 deletions
diff --git a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostHelper.java b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostHelper.java
index 946eb54ed6..84caa29237 100644
--- a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostHelper.java
+++ b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHostHelper.java
@@ -19,34 +19,12 @@
package org.apache.tuscany.sca.host.http;
-import java.util.List;
-
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
public class ServletHostHelper {
-
- private static boolean webappHost;
-
+
public static ServletHost getServletHost(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- List<ServletHost> hosts = servletHosts.getServletHosts();
- for (ServletHost servletHost : hosts) {
- if (webappHost && !"webapp".equals(servletHost.getName())) {
- continue;
- }
- if (!webappHost && "webapp".equals(servletHost.getName())) {
- continue;
- }
- if(servletHost instanceof DefaultServletHostExtensionPoint.LazyServletHost) {
- return ((DefaultServletHostExtensionPoint.LazyServletHost) servletHost).getServletHost();
- } else {
- return servletHost;
- }
- }
- throw new IllegalStateException("No ServletHost found");
- }
-
- public static void setWebappHost(boolean b) {
- ServletHostHelper.webappHost = b;
+ ExtensibleServletHost host = ExtensibleServletHost.getInstance(extensionPoints);
+ return host.getDefaultServletHost();
}
}