diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/host-http/src/main')
3 files changed, 15 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java index 3145e90164..8ecb81f843 100644 --- a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java +++ b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java @@ -27,6 +27,7 @@ import java.util.List; import javax.servlet.RequestDispatcher; import javax.servlet.Servlet; +import javax.servlet.ServletContext; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.LifeCycleListener; @@ -173,6 +174,11 @@ public class DefaultServletHostExtensionPoint implements ServletHostExtensionPoi public void stop() { ServiceHelper.stop(host); } + + @Override + public ServletContext getServletContext() { + return getServletHost().getServletContext(); + } } public void start() { diff --git a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java index 1b639041f7..107b6b3d5f 100644 --- a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java +++ b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java @@ -24,6 +24,7 @@ import java.util.List; import javax.servlet.RequestDispatcher; import javax.servlet.Servlet; +import javax.servlet.ServletContext; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.UtilityExtensionPoint; @@ -131,4 +132,9 @@ public class ExtensibleServletHost implements ServletHost { public String getName() { return getDefaultServletHost().getName(); } + + @Override + public ServletContext getServletContext() { + return getDefaultServletHost().getServletContext(); + } } diff --git a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java index 6b38559204..f70a6eddcc 100644 --- a/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java +++ b/sca-java-2.x/trunk/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java @@ -22,6 +22,7 @@ import java.net.URL; import javax.servlet.RequestDispatcher; import javax.servlet.Servlet; +import javax.servlet.ServletContext; /** * Interface implemented by host environments that allow Servlets to be @@ -35,6 +36,8 @@ import javax.servlet.Servlet; */ public interface ServletHost { + ServletContext getServletContext(); + /** * Sets the default port for the server. * |