You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2008/03/17 11:00:59 UTC

svn commit: r637812 - in /incubator/tuscany/java/sca/modules: ./ implementation-node-runtime/ implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/ implementation-node-runtime/src/main/java/org/apache/tuscany/sc...

Author: jsdelfino
Date: Mon Mar 17 03:00:52 2008
New Revision: 637812

URL: http://svn.apache.org/viewvc?rev=637812&view=rev
Log:
Moved launcher classes to a separate node2-launcher module.

Added:
    incubator/tuscany/java/sca/modules/node2-launcher/
    incubator/tuscany/java/sca/modules/node2-launcher/DISCLAIMER
    incubator/tuscany/java/sca/modules/node2-launcher/LICENSE
    incubator/tuscany/java/sca/modules/node2-launcher/NOTICE
    incubator/tuscany/java/sca/modules/node2-launcher/pom.xml   (with props)
    incubator/tuscany/java/sca/modules/node2-launcher/src/
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemon.java   (with props)
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java   (with props)
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java   (with props)
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeMain.java   (with props)
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java   (with props)
    incubator/tuscany/java/sca/modules/node2-launcher/src/test/
    incubator/tuscany/java/sca/modules/node2-launcher/src/test/java/
    incubator/tuscany/java/sca/modules/node2-launcher/src/test/resources/
Removed:
    incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationDaemon.java
    incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeImplementationLauncher.java
    incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeLauncherUtil.java
    incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeServletFilter.java
    incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/main/
Modified:
    incubator/tuscany/java/sca/modules/implementation-node-runtime/pom.xml
    incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeProcessCollectionImpl.java
    incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppRequestDispatcher.java
    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/pom.xml
    incubator/tuscany/java/sca/modules/workspace-admin/src/main/java/org/apache/tuscany/sca/workspace/admin/launcher/DomainAdminLauncher.java
    incubator/tuscany/java/sca/modules/workspace-admin/src/main/java/org/apache/tuscany/sca/workspace/admin/launcher/DomainAdminLauncherUtil.java

Modified: incubator/tuscany/java/sca/modules/implementation-node-runtime/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-node-runtime/pom.xml?rev=637812&r1=637811&r2=637812&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-node-runtime/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/implementation-node-runtime/pom.xml Mon Mar 17 03:00:52 2008
@@ -50,6 +50,12 @@
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-launcher</artifactId>
+            <version>1.2-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-host-embedded</artifactId>
             <version>1.2-incubating-SNAPSHOT</version>
         </dependency>
@@ -109,21 +115,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.implementation.node.main.NodeImplementationMain</mainClass>
-                        </manifest>
-                    </archive>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 
 </project>

Modified: incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeProcessCollectionImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeProcessCollectionImpl.java?rev=637812&r1=637811&r2=637812&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeProcessCollectionImpl.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/launcher/NodeProcessCollectionImpl.java Mon Mar 17 03:00:52 2008
@@ -32,6 +32,7 @@
 import org.apache.tuscany.sca.implementation.data.collection.ItemCollection;
 import org.apache.tuscany.sca.implementation.data.collection.LocalItemCollection;
 import org.apache.tuscany.sca.implementation.data.collection.NotFoundException;
+import org.apache.tuscany.sca.node.launcher.NodeLauncher;
 import org.osoa.sca.ServiceRuntimeException;
 import org.osoa.sca.annotations.Init;
 import org.osoa.sca.annotations.Scope;
@@ -202,7 +203,7 @@
             Properties props = System.getProperties();
             String java = props.getProperty("java.home") + "/bin/java";
             String cp = props.getProperty("java.class.path");
-            String main = NodeImplementationLauncher.class.getName();
+            String main = NodeLauncher.class.getName();
             String url = "http://localhost:9990/node-image/" + nodeName;
             final String[] command = new String[]{ java, "-cp", cp, main , url};
             

Modified: incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppRequestDispatcher.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/NodeWebAppRequestDispatcher.java?rev=637812&r1=637811&r2=637812&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppRequestDispatcher.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-node-runtime/src/main/java/org/apache/tuscany/sca/implementation/node/webapp/NodeWebAppRequestDispatcher.java Mon Mar 17 03:00:52 2008
@@ -117,4 +117,3 @@
         servlet.service(createRequestWrapper(request), response);
     }
 }
-

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=637812&r1=637811&r2=637812&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 03:00:52 2008
@@ -19,7 +19,6 @@
 
 package org.apache.tuscany.sca.implementation.node.webapp;
 
-import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.net.InetAddress;
@@ -32,8 +31,6 @@
 import java.util.Map;
 import java.util.logging.Logger;
 
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import javax.servlet.FilterConfig;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
@@ -44,7 +41,6 @@
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 
-import org.apache.tuscany.sca.host.embedded.SCADomain;
 import org.apache.tuscany.sca.host.http.ServletHost;
 import org.apache.tuscany.sca.host.http.ServletMappingException;
 import org.apache.tuscany.sca.node.NodeException;

Added: incubator/tuscany/java/sca/modules/node2-launcher/DISCLAIMER
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher/DISCLAIMER?rev=637812&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/DISCLAIMER (added)
+++ incubator/tuscany/java/sca/modules/node2-launcher/DISCLAIMER Mon Mar 17 03:00:52 2008
@@ -0,0 +1,8 @@
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+

Added: incubator/tuscany/java/sca/modules/node2-launcher/LICENSE
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher/LICENSE?rev=637812&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/LICENSE (added)
+++ incubator/tuscany/java/sca/modules/node2-launcher/LICENSE Mon Mar 17 03:00:52 2008
@@ -0,0 +1,205 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+
+
+

Added: incubator/tuscany/java/sca/modules/node2-launcher/NOTICE
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher/NOTICE?rev=637812&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/NOTICE (added)
+++ incubator/tuscany/java/sca/modules/node2-launcher/NOTICE Mon Mar 17 03:00:52 2008
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+

Added: 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=637812&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/pom.xml (added)
+++ incubator/tuscany/java/sca/modules/node2-launcher/pom.xml Mon Mar 17 03:00:52 2008
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<project>
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-modules</artifactId>
+        <version>1.2-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>tuscany-node2-launcher</artifactId>
+    <name>Apache Tuscany SCA Node Launcher</name>
+
+    <dependencies>   
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <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>
+        <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>

Propchange: incubator/tuscany/java/sca/modules/node2-launcher/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/node2-launcher/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemon.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemon.java?rev=637812&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemon.java (added)
+++ incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeDaemon.java Mon Mar 17 03:00:52 2008
@@ -0,0 +1,82 @@
+/*
+ * 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;
+
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * A launcher for the SCA Node daemon.
+ *  
+ * @version $Rev$ $Date$
+ */
+public class NodeDaemon {
+
+    private final static Logger logger = Logger.getLogger(NodeDaemon.class.getName());
+    
+    public static void main(String[] args) throws Exception {
+        logger.info("Apache Tuscany SCA Node Daemon starting...");
+
+        Class<?> daemonClass;
+        Object daemon;
+        try {
+            // Set up runtime classloader
+            ClassLoader runtimeClassLoader = NodeLauncherUtil.runtimeClassLoader(Thread.currentThread().getContextClassLoader());
+            if (runtimeClassLoader != null) {
+                Thread.currentThread().setContextClassLoader(runtimeClassLoader);
+            }
+
+            // Create the daemon
+            
+            // We use Java reflection here as only the runtime class
+            // loader knows the runtime classes required by the daemon
+            String className = "org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationDaemonBootstrap";
+            if (runtimeClassLoader != null) {
+                daemonClass = Class.forName(className, true, runtimeClassLoader);
+            } else {
+                daemonClass = Class.forName(className);
+            }
+            daemon = daemonClass.getConstructor().newInstance();
+            
+            // Start the daemon
+            daemonClass.getMethod("start").invoke(daemon);
+            
+        } catch (Exception e) {
+            logger.log(Level.SEVERE, "SCA Node Daemon could not be started", e);
+            throw e;
+        }
+        
+        logger.info("SCA Node Daemon started.");
+        logger.info("Press enter to shutdown.");
+        try {
+            System.in.read();
+        } catch (IOException e) {}
+
+        // Stop the daemon
+        try {
+            daemonClass.getMethod("stop").invoke(daemon);
+        } catch (Exception e) {
+            logger.log(Level.SEVERE, "SCA Node Daemon could not be stopped", e);
+            throw e;
+        }
+    }
+
+}

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

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

Added: incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java?rev=637812&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java (added)
+++ incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java Mon Mar 17 03:00:52 2008
@@ -0,0 +1,85 @@
+/*
+ * 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;
+
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * A launcher for standalone SCA nodes.
+ *  
+ * @version $Rev$ $Date$
+ */
+public class NodeLauncher {
+
+    private final static Logger logger = Logger.getLogger(NodeLauncher.class.getName());
+
+    public static void main(String[] args) throws Exception {
+        logger.info("Apache Tuscany SCA Node starting...");
+
+        Class<?> nodeClass;
+        Object node;
+        try {
+            String configurationURI = args[0];
+            logger.info("SCA Node configuration: " + configurationURI);
+
+            // Set up runtime classloader
+            ClassLoader runtimeClassLoader = NodeLauncherUtil.runtimeClassLoader(Thread.currentThread().getContextClassLoader());
+            if (runtimeClassLoader != null) {
+                Thread.currentThread().setContextClassLoader(runtimeClassLoader);
+            }
+            
+            // Create the node
+            
+            // We use Java reflection here as only the runtime class
+            // loader knows the runtime classes required by the node
+            String className = "org.apache.tuscany.sca.implementation.node.launcher.NodeImplementationLauncherBootstrap";
+            if (runtimeClassLoader != null) {
+                nodeClass = Class.forName(className, true, runtimeClassLoader);
+            } else {
+                nodeClass = Class.forName(className);
+            }
+            node = nodeClass.getConstructor(String.class).newInstance(configurationURI);
+            
+            // Start the node
+            nodeClass.getMethod("start").invoke(node);
+            
+        } catch (Exception e) {
+            logger.log(Level.SEVERE, "SCA Node could not be started", e);
+            throw e;
+        }
+        
+        logger.info("SCA Node started.");
+        logger.info("Press enter to shutdown.");
+        try {
+            System.in.read();
+        } catch (IOException e) {}
+
+        // Stop the node
+        try {
+            nodeClass.getMethod("stop").invoke(node);
+        } catch (Exception e) {
+            logger.log(Level.SEVERE, "SCA Node could not be stopped", e);
+            throw e;
+        }
+    }
+
+}

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

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

Added: incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java?rev=637812&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java (added)
+++ incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java Mon Mar 17 03:00:52 2008
@@ -0,0 +1,180 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+
+/**
+ * Common functions and constants used by the admin components.
+ *
+ * @version $Rev$ $Date$
+ */
+public final class NodeLauncherUtil {
+
+    private final static Logger logger = Logger.getLogger(NodeLauncherUtil.class.getName());
+    
+    private static final String TUSCANY_HOME = "TUSCANY_HOME";
+
+
+    /**
+     * Returns a classloader for the Tuscany runtime JARs.
+     * 
+     * @param parentClassLoader
+     * 
+     * @return
+     */
+    static ClassLoader runtimeClassLoader(ClassLoader parentClassLoader) throws FileNotFoundException, URISyntaxException, MalformedURLException {
+        
+        // Build list of runtime JARs
+        List<URL> jarURLs = new ArrayList<URL>();
+        
+        // First determine the path to the launcher class
+        String resource = NodeLauncherUtil.class.getName().replace('.', '/') + ".class"; 
+        URL url = NodeLauncherUtil.class.getClassLoader().getResource(resource);
+        if (url == null) {
+            throw new FileNotFoundException(resource);
+        }
+        URI uri = url.toURI();
+            
+        // If the launcher class is in a JAR, add all runtime JARs from the same directory
+        String scheme = uri.getScheme();
+        if (scheme.equals("jar")) {
+            String path = uri.toString().substring(4);
+            int i = path.indexOf("!/");
+            if (i != -1) {
+                path = path.substring(0, i);
+                uri = URI.create(path);
+            }
+    
+            File file = new File(uri);
+            if (file.exists()) {
+                File directory = file.getParentFile();
+                collectJARFiles(directory, jarURLs);
+            }
+        }
+        
+        // Look for a TUSCANY_HOME system property or environment variable
+        // Add all the JARs found under $TUSCANY_HOME, $TUSCANY_HOME/modules
+        // and $TUSCANY_HOME/lib
+        String home = System.getProperty(NodeLauncherUtil.TUSCANY_HOME);
+        if (home == null || home.length() == 0) {
+            home = System.getenv(NodeLauncherUtil.TUSCANY_HOME);
+        }
+        if (home != null && home.length() != 0) {
+            NodeLauncherUtil.logger.info(NodeLauncherUtil.TUSCANY_HOME + ": " + home);
+            File homeDirectory = new File(home);
+            if (homeDirectory.exists()) {
+                
+                // Collect files under $TUSCANY_HOME
+                collectJARFiles(homeDirectory, jarURLs);
+                
+                // Collect files under $TUSCANY_HOME/modules
+                File moduleDirectory = new File(homeDirectory, "modules");
+                if (moduleDirectory.exists()) {
+                    collectJARFiles(moduleDirectory, jarURLs);
+                }
+    
+                // Collect files under $TUSCANY_HOME/lib
+                File libDirectory = new File(homeDirectory, "lib");
+                if (libDirectory.exists()) {
+                    collectJARFiles(libDirectory, jarURLs);
+                }
+            }
+        }
+    
+        // Return the runtime class loader
+        if (!jarURLs.isEmpty()) {
+            
+            // Return a classloader configured with the runtime JARs
+            ClassLoader classLoader = new URLClassLoader(jarURLs.toArray(new URL[0]), parentClassLoader);
+            return classLoader;
+            
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Collect JAR files in the given directory
+     * @param directory
+     * @param urls
+     * @throws MalformedURLException
+     */
+    private static void collectJARFiles(File directory, List<URL> urls) throws MalformedURLException {
+        File[] files = directory.listFiles(new FilenameFilter() {
+    
+            public boolean accept(File dir, String name) {
+                name = name.toLowerCase(); 
+                
+                // Exclude tuscany-sca-all and tuscany-sca-manifest as they duplicate
+                // code in the individual runtime module JARs
+                if (name.startsWith("tuscany-sca-all")) {
+                    return false;
+                }
+                if (name.startsWith("tuscany-sca-manifest")) {
+                    return false;
+                }
+                
+                // Filter out the Jetty and Webapp hosts
+                if (name.startsWith("tuscany-host-jetty") || name.startsWith("tuscany-host-webapp")) {
+                    //FIXME This is temporary
+                    return false;
+                }
+                
+                // Include JAR and MAR files
+                if (name.endsWith(".jar")) {
+                    return true;
+                }
+                if (name.endsWith(".mar")) {
+                    return true;
+                }
+                return false;
+            }
+        });
+    
+        if (files != null) {
+            int count = 0;
+            for (File file: files) {
+                URL url = file.toURI().toURL();
+                
+                // Collect URL of the JAR file, make sure that there are no
+                // duplicates in the list
+                if (!urls.contains(url)) {
+                    urls.add(url);
+                    count++;
+                }
+            }
+            if (count != 0) {
+                logger.info("Runtime classpath: "+ count + " JAR" + (count > 1? "s":"")+ " from " + directory.toString());
+            }
+        }
+    }
+
+}

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

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

Added: incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeMain.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeMain.java?rev=637812&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeMain.java (added)
+++ incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeMain.java Mon Mar 17 03:00:52 2008
@@ -0,0 +1,39 @@
+/*
+ * 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;
+
+
+/**
+ * Main class for this JAR.
+ * With no arguments this class launches the SCA Node Daemon.
+ * With an argument it launches an SCA node. 
+ *  
+ * @version $Rev$ $Date$
+ */
+public class NodeMain {
+
+    public static void main(String[] args) throws Exception {
+        if (args.length != 0) {
+            NodeLauncher.main(args);
+        } else {
+            NodeDaemon.main(args);
+        }
+    }
+}

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

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

Added: incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java?rev=637812&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java (added)
+++ incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java Mon Mar 17 03:00:52 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;
+
+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(final FilterConfig config) throws ServletException {
+        logger.info("Apache Tuscany SCA WebApp Node starting...");
+
+        try {
+            // Get the Tuscany runtime classloader
+            ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+            runtimeClassLoader = NodeLauncherUtil.runtimeClassLoader(tccl);
+            
+            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.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(config);
+    
+                // 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/src/main/java/org/apache/tuscany/sca/node/launcher/NodeServletFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Modified: incubator/tuscany/java/sca/modules/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/pom.xml?rev=637812&r1=637811&r2=637812&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/pom.xml Mon Mar 17 03:00:52 2008
@@ -131,6 +131,7 @@
                 <module>node2-api</module>
                 <module>node-impl</module>
                 <module>node2-impl</module>
+                <module>node2-launcher</module>
                 <module>osgi-runtime</module>
                 <module>policy</module>
                 <module>policy-xml</module>

Modified: incubator/tuscany/java/sca/modules/workspace-admin/src/main/java/org/apache/tuscany/sca/workspace/admin/launcher/DomainAdminLauncher.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/workspace-admin/src/main/java/org/apache/tuscany/sca/workspace/admin/launcher/DomainAdminLauncher.java?rev=637812&r1=637811&r2=637812&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/workspace-admin/src/main/java/org/apache/tuscany/sca/workspace/admin/launcher/DomainAdminLauncher.java (original)
+++ incubator/tuscany/java/sca/modules/workspace-admin/src/main/java/org/apache/tuscany/sca/workspace/admin/launcher/DomainAdminLauncher.java Mon Mar 17 03:00:52 2008
@@ -39,14 +39,21 @@
         Object admin;
         try {
             // Set up runtime classloader
-            ClassLoader runtimeClassLoader = DomainAdminLauncherUtil.runtimeClassLoader();
-            Thread.currentThread().setContextClassLoader(runtimeClassLoader);
+            ClassLoader runtimeClassLoader = DomainAdminLauncherUtil.runtimeClassLoader(Object.class.getClassLoader());
+            if (runtimeClassLoader != null) {
+                Thread.currentThread().setContextClassLoader(runtimeClassLoader);
+            }
 
             // Create the daemon
             
             // We use Java reflection here as only the runtime class
             // loader knows the runtime classes required by the daemon
-            adminClass = runtimeClassLoader.loadClass("org.apache.tuscany.sca.workspace.admin.launcher.DomainAdminLauncherBootstrap"); 
+            String className = "org.apache.tuscany.sca.workspace.admin.launcher.DomainAdminLauncherBootstrap";
+            if (runtimeClassLoader != null) {
+                adminClass = Class.forName(className, true, runtimeClassLoader);
+            } else {
+                adminClass = Class.forName(className);
+            }
             admin = adminClass.getConstructor().newInstance();
             
             // Start the daemon

Modified: incubator/tuscany/java/sca/modules/workspace-admin/src/main/java/org/apache/tuscany/sca/workspace/admin/launcher/DomainAdminLauncherUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/workspace-admin/src/main/java/org/apache/tuscany/sca/workspace/admin/launcher/DomainAdminLauncherUtil.java?rev=637812&r1=637811&r2=637812&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/workspace-admin/src/main/java/org/apache/tuscany/sca/workspace/admin/launcher/DomainAdminLauncherUtil.java (original)
+++ incubator/tuscany/java/sca/modules/workspace-admin/src/main/java/org/apache/tuscany/sca/workspace/admin/launcher/DomainAdminLauncherUtil.java Mon Mar 17 03:00:52 2008
@@ -46,9 +46,11 @@
     /**
      * Returns a classloader for the Tuscany runtime JARs.
      * 
+     * @param parentClassLoader
+     * 
      * @return
      */
-    static ClassLoader runtimeClassLoader() throws FileNotFoundException, URISyntaxException, MalformedURLException {
+    static ClassLoader runtimeClassLoader(ClassLoader parentClassLoader) throws FileNotFoundException, URISyntaxException, MalformedURLException {
         
         // Build list of runtime JARs
         List<URL> jarURLs = new ArrayList<URL>();
@@ -108,16 +110,14 @@
         }
     
         // Return the runtime class loader
-        if (jarURLs.isEmpty()) {
-            
-            // Just return the current context class loader
-            return Thread.currentThread().getContextClassLoader();
-            
-        } else {
+        if (!jarURLs.isEmpty()) {
             
             // Return a classloader configured with the runtime JARs
             ClassLoader classLoader = new URLClassLoader(jarURLs.toArray(new URL[0]), Object.class.getClassLoader());
             return classLoader;
+            
+        } else {
+            return null;
         }
     }
 



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