tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r432823 - in /incubator/tuscany/java/sca/runtime/webapp: pom.xml src/main/java/org/apache/tuscany/runtime/webapp/TuscanyServlet.java
Date Sat, 19 Aug 2006 09:45:53 GMT
Author: antelder
Date: Sat Aug 19 02:45:53 2006
New Revision: 432823

URL: http://svn.apache.org/viewvc?rev=432823&view=rev
Log:
Add new TuscanyServlet that dispatches servlet requests to the Tuscany runtime

Modified:
    incubator/tuscany/java/sca/runtime/webapp/pom.xml
    incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyServlet.java

Modified: incubator/tuscany/java/sca/runtime/webapp/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp/pom.xml?rev=432823&r1=432822&r2=432823&view=diff
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp/pom.xml (original)
+++ incubator/tuscany/java/sca/runtime/webapp/pom.xml Sat Aug 19 02:45:53 2006
@@ -38,16 +38,9 @@
 
         <dependency>
             <groupId>org.apache.tuscany</groupId>
-            <artifactId>spi</artifactId>
+            <artifactId>host-api</artifactId>
             <version>${sca.version}</version>
             <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany</groupId>
-            <artifactId>test</artifactId>
-            <version>${sca.version}</version>
-            <scope>test</scope>
         </dependency>
 
         <dependency>

Modified: incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyServlet.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyServlet.java?rev=432823&r1=432822&r2=432823&view=diff
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyServlet.java
(original)
+++ incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyServlet.java
Sat Aug 19 02:45:53 2006
@@ -27,39 +27,27 @@
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServlet;
 
-import org.apache.tuscany.spi.component.CompositeComponent;
-import org.apache.tuscany.spi.component.SCAObject;
+import org.apache.tuscany.host.servlet.ServletRequestInjector;
 
 /**
- * A servlet that locates the ServletHost and forwards requests into the Tuscany runtime.
+ * A servlet that locates the ServletRequestInjector and forwards requests into the Tuscany
runtime. 
  * Needs to be added to the webapp web.xml
  */
 public class TuscanyServlet extends HttpServlet {
 
     private static final long serialVersionUID = 1L;
 
-    private ServletHostImpl servletHost;
+    private ServletRequestInjector servletRequestInjector;
 
     @Override
     public void init(ServletConfig config) {
-
         ServletContext servletContext = config.getServletContext();
-        CompositeComponent systemComposite = (CompositeComponent) servletContext.getAttribute("Tuscany.SystemComposite");
-        if (systemComposite == null) {
-            Throwable e = (Throwable) servletContext.getAttribute("Tuscany.Launcher.Throwable");
-            throw new RuntimeException("SystemComposite not found", e);
-        }
-
-        SCAObject o = systemComposite.getChild("ServletHost");
-        if (o == null) {
-            throw new RuntimeException("ServletHost not found");
-        }
-        servletHost = (ServletHostImpl) o.getServiceInstance();
+        this.servletRequestInjector = (ServletRequestInjector) servletContext.getAttribute("Tuscany.ServletRequestInjector");
     }
 
     @Override
     public void service(ServletRequest req, ServletResponse res) throws ServletException,
IOException {
-        servletHost.handleService(req, res);
+        servletRequestInjector.service(req, res);
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message