Author: jsdelfino
Date: Mon Mar 17 04:30:48 2008
New Revision: 637842

URL: http://svn.apache.org/viewvc?rev=637842&view=rev
Log:
Moved Node2 Webapp launcher to its own module. Fixed build break caused by 
duplicate exception class.

Added:
    
incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppModuleActivator.java
   (with props)
    
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/Node2Exception.java
      - copied, changed from r637810, 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/NodeException.java
    incubator/tuscany/java/sca/modules/node2-launcher-webapp/
      - copied from r637816, incubator/tuscany/java/sca/modules/node2-launcher/
    incubator/tuscany/java/sca/modules/node2-launcher-webapp/DISCLAIMER
      - copied unchanged from r637841, 
incubator/tuscany/java/sca/modules/node2-launcher/DISCLAIMER
    incubator/tuscany/java/sca/modules/node2-launcher-webapp/LICENSE
      - copied unchanged from r637841, 
incubator/tuscany/java/sca/modules/node2-launcher/LICENSE
    incubator/tuscany/java/sca/modules/node2-launcher-webapp/NOTICE
      - copied unchanged from r637841, 
incubator/tuscany/java/sca/modules/node2-launcher/NOTICE
    incubator/tuscany/java/sca/modules/node2-launcher-webapp/pom.xml
      - copied, changed from r637841, 
incubator/tuscany/java/sca/modules/node2-launcher/pom.xml
    incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/
      - copied from r637841, 
incubator/tuscany/java/sca/modules/node2-launcher/src/
    
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/webapp/
    
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/webapp/NodeServletFilter.java
   (with props)
    incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/resources/
    
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/resources/META-INF/
    
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/resources/META-INF/services/
    
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
Removed:
    
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/NodeException.java
    
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemon.java
    
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java
    
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java
    
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/NodeMain.java
    
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java
    
incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java
Modified:
    
incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppServletHost.java
    
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2.java
    
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java
    
incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
    
incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
    incubator/tuscany/java/sca/modules/node2-launcher/pom.xml
    incubator/tuscany/java/sca/modules/pom.xml

Added: 
incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppModuleActivator.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppModuleActivator.java?rev=637842&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppModuleActivator.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppModuleActivator.java
 Mon Mar 17 04:30:48 2008
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.implementation.node.webapp;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ModuleActivator;
+import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
+
+/**
+ * Activates the webapp host by registering the webapp ServletHost.
+ */
+public class NodeWebAppModuleActivator implements ModuleActivator {
+
+    public void start(ExtensionPointRegistry extensionPointRegistry) {
+
+        ServletHostExtensionPoint servletHosts =
+            
extensionPointRegistry.getExtensionPoint(ServletHostExtensionPoint.class);
+
+        servletHosts.addServletHost(NodeWebAppServletHost.servletHost());
+    }
+
+    public void stop(ExtensionPointRegistry registry) {
+    }
+
+}

Propchange: 
incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppModuleActivator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppModuleActivator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: 
incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppServletHost.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppServletHost.java?rev=637842&r1=637841&r2=637842&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppServletHost.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppServletHost.java
 Mon Mar 17 04:30:48 2008
@@ -31,6 +31,7 @@
 import java.util.Map;
 import java.util.logging.Logger;
 
+import javax.servlet.Filter;
 import javax.servlet.FilterConfig;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
@@ -43,7 +44,7 @@
 
 import org.apache.tuscany.sca.host.http.ServletHost;
 import org.apache.tuscany.sca.host.http.ServletMappingException;
-import org.apache.tuscany.sca.node.NodeException;
+import org.apache.tuscany.sca.node.Node2Exception;
 import org.apache.tuscany.sca.node.SCANode2;
 import org.apache.tuscany.sca.node.SCANode2Factory;
 
@@ -52,7 +53,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class NodeWebAppServletHost implements ServletHost {
+public class NodeWebAppServletHost implements ServletHost, Filter {
     private static final Logger logger = 
Logger.getLogger(NodeWebAppServletHost.class.getName());
 
     public static final String SCA_NODE_ATTRIBUTE = 
"org.apache.tuscany.sca.SCANode";
@@ -64,7 +65,6 @@
     
     private String contextPath = "/";
     private int defaultPort = 8080;
-    private String contributionRoot;
 
     /**
      * Constructs a new NodeWebAppServletHost.
@@ -129,7 +129,7 @@
         SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
         try {
             node = nodeFactory.createSCANode(nodeImage);
-        } catch (NodeException e) {
+        } catch (Node2Exception e) {
             throw new ServletException(e);
         }
 
@@ -139,7 +139,7 @@
         // Start the node
         try {
             node.start();
-        } catch (NodeException e) {
+        } catch (Node2Exception e) {
             throw new ServletException(e);
         }
 
@@ -279,7 +279,7 @@
      * 
      * @throws ServletException
      */
-    public void destroy() throws ServletException {
+    public void destroy() {
 
         // Destroy the registered servlets
         for (Servlet servlet : servlets.values()) {
@@ -290,8 +290,8 @@
         if (node != null) {
             try {
                 node.stop();
-            } catch (NodeException e) {
-                throw new ServletException(e);
+            } catch (Node2Exception e) {
+                throw new RuntimeException(e);
             }
         }
     }

Copied: 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/Node2Exception.java
 (from r637810, 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/NodeException.java)
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/Node2Exception.java?p2=incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/Node2Exception.java&p1=incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/NodeException.java&r1=637810&r2=637842&rev=637842&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/NodeException.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/Node2Exception.java
 Mon Mar 17 04:30:48 2008
@@ -26,11 +26,11 @@
  *
  * @version $Rev: 568826 $ $Date: 2007-08-23 06:27:34 +0100 (Thu, 23 Aug 2007) 
$
  */
-public class NodeException extends ServiceRuntimeException {
+public class Node2Exception extends ServiceRuntimeException {
 
     static final long serialVersionUID = 2096658015909178325L;
 
-    public NodeException() {
+    public Node2Exception() {
         super();
     }
 
@@ -38,21 +38,21 @@
      * @param message
      * @param cause
      */
-    public NodeException(String message, Throwable cause) {
+    public Node2Exception(String message, Throwable cause) {
         super(message, cause);
     }
 
     /**
      * @param message
      */
-    public NodeException(String message) {
+    public Node2Exception(String message) {
         super(message);
     }
 
     /**
      * @param cause
      */
-    public NodeException(Throwable cause) {
+    public Node2Exception(Throwable cause) {
         super(cause);
     }
 }

Modified: 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2.java?rev=637842&r1=637841&r2=637842&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2.java
 Mon Mar 17 04:30:48 2008
@@ -32,11 +32,11 @@
     /**
      * Start the composite loaded in the node.
      */
-    public void start() throws NodeException;    
+    public void start() throws Node2Exception;    
     
     /**
      * Stop the composite loaded in the node.
      */
-    public void stop() throws NodeException;    
+    public void stop() throws Node2Exception;    
 
 }

Modified: 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java?rev=637842&r1=637841&r2=637842&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java
 Mon Mar 17 04:30:48 2008
@@ -71,6 +71,6 @@
      * @param configurationURI the URI of the node configuration 
      * @return a new SCA node.
      */
-    public abstract SCANode2 createSCANode(String configurationURI) throws 
NodeException;
+    public abstract SCANode2 createSCANode(String configurationURI) throws 
Node2Exception;
 
 }

Modified: 
incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java?rev=637842&r1=637841&r2=637842&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
 Mon Mar 17 04:30:48 2008
@@ -19,7 +19,7 @@
 
 package org.apache.tuscany.sca.node.impl;
 
-import org.apache.tuscany.sca.node.NodeException;
+import org.apache.tuscany.sca.node.Node2Exception;
 import org.apache.tuscany.sca.node.SCANode2;
 import org.apache.tuscany.sca.node.SCANode2Factory;
 
@@ -33,7 +33,7 @@
     public NodeFactoryImpl() {
     }
 
-    public SCANode2 createSCANode(String configurationURI) throws 
NodeException {
+    public SCANode2 createSCANode(String configurationURI) throws 
Node2Exception {
         return new NodeImpl(configurationURI);
     }
 }

Modified: 
incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java?rev=637842&r1=637841&r2=637842&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/node2-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
 Mon Mar 17 04:30:48 2008
@@ -50,7 +50,7 @@
 import org.apache.tuscany.sca.implementation.node.ConfiguredNodeImplementation;
 import org.apache.tuscany.sca.interfacedef.InterfaceContract;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.node.NodeException;
+import org.apache.tuscany.sca.node.Node2Exception;
 import org.apache.tuscany.sca.node.SCAClient;
 import org.apache.tuscany.sca.node.SCANode2;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
@@ -83,14 +83,14 @@
      * Constructs a new SCA node.
      *  
      * @param configurationURI the URI of the node configuration information.
-     * @throws NodeException
+     * @throws Node2Exception
      */
-    public NodeImpl(String configurationURI) throws NodeException {
+    public NodeImpl(String configurationURI) throws Node2Exception {
         try {
             init(configurationURI);
 
         } catch (Exception e) {
-            throw new NodeException(e);
+            throw new Node2Exception(e);
         }        
     }
     
@@ -159,7 +159,7 @@
         activator.activate(composite);
     }
     
-    public void start() throws NodeException {
+    public void start() throws Node2Exception {
         logger.log(Level.INFO, "Starting node: " + configurationURI);          
     
         
         try {
@@ -168,11 +168,11 @@
             activator.start(composite);
             
         } catch (ActivationException e) {
-            throw new NodeException(e);
+            throw new Node2Exception(e);
         }
     }
     
-    public void stop() throws NodeException {
+    public void stop() throws Node2Exception {
         logger.log(Level.INFO, "Stopping node: " + configurationURI);          
     
         
         try {
@@ -181,7 +181,7 @@
             activator.stop(composite);
             
         } catch (ActivationException e) {
-            throw new NodeException(e);
+            throw new Node2Exception(e);
         }
     }
     

Copied: incubator/tuscany/java/sca/modules/node2-launcher-webapp/pom.xml (from 
r637841, incubator/tuscany/java/sca/modules/node2-launcher/pom.xml)
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher-webapp/pom.xml?p2=incubator/tuscany/java/sca/modules/node2-launcher-webapp/pom.xml&p1=incubator/tuscany/java/sca/modules/node2-launcher/pom.xml&r1=637841&r2=637842&rev=637842&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/node2-launcher-webapp/pom.xml Mon Mar 17 
04:30:48 2008
@@ -27,8 +27,8 @@
         <relativePath>../pom.xml</relativePath>
     </parent>
 
-    <artifactId>tuscany-node2-launcher</artifactId>
-    <name>Apache Tuscany SCA Node Launcher</name>
+    <artifactId>tuscany-node2-launcher-webapp</artifactId>
+    <name>Apache Tuscany SCA WebApp Node Launcher</name>
 
     <dependencies>   
         <dependency>
@@ -38,6 +38,13 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-node-runtime</artifactId>
+            <version>1.2-incubating-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
             <version>2.4</version> <!-- to keep compatible with older servlet 
containers --> 
@@ -45,21 +52,5 @@
         </dependency>
 
     </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            
<mainClass>org.apache.tuscany.sca.node.launcher.NodeMain</mainClass>
-                        </manifest>
-                    </archive>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 
 </project>

Added: 
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/webapp/NodeServletFilter.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/webapp/NodeServletFilter.java?rev=637842&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/webapp/NodeServletFilter.java
 (added)
+++ 
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/webapp/NodeServletFilter.java
 Mon Mar 17 04:30:48 2008
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.node.launcher.webapp;
+
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+/**
+ * A servlet filter that forwards service requests to the servlets registered 
with
+ * the Tuscany ServletHost.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class NodeServletFilter implements Filter {
+    private static final long serialVersionUID = 1L;
+
+    private static final Logger logger = 
Logger.getLogger(NodeServletFilter.class.getName());
+
+    private ClassLoader runtimeClassLoader;
+    private Class<?> servletHostClass;
+    private Object servletHost;
+    private Filter filter;
+
+    public void init(FilterConfig filterConfig) throws ServletException {
+        logger.info("Apache Tuscany SCA WebApp Node starting...");
+
+        try {
+            // Get the Tuscany runtime classloader
+            ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+            runtimeClassLoader = 
NodeLauncherUtil.runtimeClassLoader(getClass().getClassLoader());
+            
+            try {
+                if (runtimeClassLoader != null) {
+                    
Thread.currentThread().setContextClassLoader(runtimeClassLoader);
+                }
+        
+                // Load the Tuscany WebApp servlet host and get the host 
instance
+                // for the current webapp
+                String className = 
"org.apache.tuscany.sca.implementation.node.webapp.NodeWebAppServletHost"; 
+                if (runtimeClassLoader != null) {
+                    servletHostClass = Class.forName(className, true, 
runtimeClassLoader);
+                } else {
+                    servletHostClass = Class.forName(className);
+                }
+                servletHost = 
servletHostClass.getMethod("servletHost").invoke(null);
+        
+                // Initialize the servlet host
+                servletHostClass.getMethod("init", 
FilterConfig.class).invoke(servletHost, filterConfig);
+    
+                // The servlet host also implements the filter interface 
+                filter = (Filter)servletHost;
+                
+            } finally {
+                Thread.currentThread().setContextClassLoader(tccl);
+            }
+            
+        } catch (Exception e) {
+            logger.log(Level.SEVERE, "Error Starting SCA WebApp Node", e);
+            throw new ServletException(e);
+        }
+
+        logger.info("SCA WebApp Node started.");
+    }
+
+    public void destroy() {
+        logger.info("Apache Tuscany WebApp Node stopping...");
+        if (servletHost != null) {
+            ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+            try {
+                if (runtimeClassLoader != null) {
+                    
Thread.currentThread().setContextClassLoader(runtimeClassLoader);
+                }
+                
+                servletHostClass.getMethod("destroy").invoke(servletHost);
+                
+            } catch (Exception e) {
+                logger.log(Level.SEVERE, "Error Stopping SCA WebApp Node", e);
+            } finally {
+                Thread.currentThread().setContextClassLoader(tccl);
+            }
+        }
+        logger.info("SCA WebApp Node stopped.");
+    }
+
+    public void doFilter(ServletRequest request, ServletResponse response, 
javax.servlet.FilterChain chain)
+        throws IOException, ServletException {
+
+        // Delegate to the servlet host filter
+        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+        try {
+            if (runtimeClassLoader != null) {
+                
Thread.currentThread().setContextClassLoader(runtimeClassLoader);
+            }
+            
+            filter.doFilter(request, response, chain);
+            
+        } finally {
+            Thread.currentThread().setContextClassLoader(tccl);
+        }
+    }
+
+}

Propchange: 
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/webapp/NodeServletFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/java/org/apache/tuscany/sca/node/launcher/webapp/NodeServletFilter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator?rev=637842&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
 (added)
+++ 
incubator/tuscany/java/sca/modules/node2-launcher-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
 Mon Mar 17 04:30:48 2008
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Implementation class for the ModuleActivator
+org.apache.tuscany.sca.implementation.node.webapp.NodeWebAppModuleActivator

Modified: incubator/tuscany/java/sca/modules/node2-launcher/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher/pom.xml?rev=637842&r1=637841&r2=637842&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/node2-launcher/pom.xml Mon Mar 17 
04:30:48 2008
@@ -37,13 +37,6 @@
             <version>1.2-incubating-SNAPSHOT</version>
         </dependency>
 
-        <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>2.4</version> <!-- to keep compatible with older servlet 
containers --> 
-            <scope>provided</scope>
-        </dependency>
-
     </dependencies>
 
     <build>

Modified: incubator/tuscany/java/sca/modules/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/pom.xml?rev=637842&r1=637841&r2=637842&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/pom.xml Mon Mar 17 04:30:48 2008
@@ -132,6 +132,7 @@
                 <module>node-impl</module>
                 <module>node2-impl</module>
                 <module>node2-launcher</module>
+                <module>node2-launcher-webapp</module>
                 <module>osgi-runtime</module>
                 <module>policy</module>
                 <module>policy-xml</module>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to