tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r662674 - in /incubator/tuscany/java/sca: modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/ tools/eclipse/plugins/core/ tools/eclipse/plugins/core/exsd/ tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpa...
Date Tue, 03 Jun 2008 07:33:25 GMT
Author: jsdelfino
Date: Tue Jun  3 00:33:24 2008
New Revision: 662674

URL: http://svn.apache.org/viewvc?rev=662674&view=rev
Log:
Added an extension point to the Eclipse plugin to allow plugins to add classpath entries to
the Tuscany runtime classpath used when launching nodes and the domain manager.

Added:
    incubator/tuscany/java/sca/tools/eclipse/plugins/core/exsd/
    incubator/tuscany/java/sca/tools/eclipse/plugins/core/exsd/runtimeLibraries.exsd
    incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/ClasspathUtil.java
    incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyRuntimeClasspathContainer.java
Modified:
    incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java
    incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java
    incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/DomainManagerLauncherUtil.java
    incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/NodeLauncherUtil.java
    incubator/tuscany/java/sca/tools/eclipse/plugins/core/plugin.xml

Modified: 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=662674&r1=662673&r2=662674&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java
(original)
+++ incubator/tuscany/java/sca/modules/node2-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java
Tue Jun  3 00:33:24 2008
@@ -35,6 +35,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.StringTokenizer;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -48,6 +49,7 @@
     private static final Logger logger = Logger.getLogger(NodeLauncherUtil.class.getName());
     
     private static final String TUSCANY_HOME = "TUSCANY_HOME";
+    private static final String TUSCANY_PATH = "TUSCANY_PATH";
 
 
     /**
@@ -151,29 +153,21 @@
         }
         if (home != null && home.length() != 0) {
             logger.fine(TUSCANY_HOME + ": " + home);
-            File homeDirectory = new File(home);
-            URL homeDirectoryURL = homeDirectory.toURI().toURL(); 
-            if (!jarDirectoryURLs.contains(homeDirectoryURL) && homeDirectory.exists())
{
-                
-                // Collect files under $TUSCANY_HOME
-                jarDirectoryURLs.add(homeDirectoryURL);
-                collectJARFiles(homeDirectory, jarURLs, filter);
-                
-                // Collect files under $TUSCANY_HOME/modules
-                File modulesDirectory = new File(homeDirectory, "modules");
-                URL modulesDirectoryURL = modulesDirectory.toURI().toURL(); 
-                if (!jarDirectoryURLs.contains(modulesDirectoryURL) && modulesDirectory.exists())
{
-                    jarDirectoryURLs.add(modulesDirectoryURL);
-                    collectJARFiles(modulesDirectory, jarURLs, filter);
-                }
+            collectJARFiles(home, jarDirectoryURLs, jarURLs, filter);
+        }
     
-                // Collect files under $TUSCANY_HOME/lib
-                File libDirectory = new File(homeDirectory, "lib");
-                URL libDirectoryURL = libDirectory.toURI().toURL(); 
-                if (!jarDirectoryURLs.contains(libDirectoryURL) && libDirectory.exists())
{
-                    jarDirectoryURLs.add(libDirectoryURL);
-                    collectJARFiles(libDirectory, jarURLs, filter);
-                }
+        // Look for a TUSCANY_PATH system property or environment variable
+        // Add all the JARs found under $TUSCANY_PATH, $TUSCANY_PATH/modules
+        // and $TUSCANY_PATH/lib
+        String ext = System.getProperty(TUSCANY_PATH);
+        if (ext == null || ext.length() == 0) {
+            ext = System.getenv(TUSCANY_PATH);
+        }
+        if (ext != null && ext.length() != 0) {
+            logger.fine(TUSCANY_PATH + ": " + ext);
+            String separator = System.getProperty("path.separator");
+            for (StringTokenizer tokens = new StringTokenizer(ext, separator); tokens.hasMoreTokens();
) {
+                collectJARFiles(tokens.nextToken(), jarDirectoryURLs, jarURLs, filter);
             }
         }
     
@@ -190,6 +184,43 @@
     }
 
     /**
+     * Collect JAR files under the given directory.
+     * 
+     * @param directory
+     * @param jarDirectoryURLs
+     * @param jarURLs
+     * @param filter
+     * @throws MalformedURLException
+     */
+    private static void collectJARFiles(String directory, Set<URL> jarDirectoryURLs,
List<URL> jarURLs, FilenameFilter filter)
+        throws MalformedURLException {
+        File directoryFile = new File(directory);
+        URL directoryURL = directoryFile.toURI().toURL(); 
+        if (!jarDirectoryURLs.contains(directoryURL) && directoryFile.exists()) {
+            
+            // Collect files under $TUSCANY_HOME
+            jarDirectoryURLs.add(directoryURL);
+            collectJARFiles(directoryFile, jarURLs, filter);
+            
+            // Collect files under $TUSCANY_HOME/modules
+            File modulesDirectory = new File(directoryFile, "modules");
+            URL modulesDirectoryURL = modulesDirectory.toURI().toURL(); 
+            if (!jarDirectoryURLs.contains(modulesDirectoryURL) && modulesDirectory.exists())
{
+                jarDirectoryURLs.add(modulesDirectoryURL);
+                collectJARFiles(modulesDirectory, jarURLs, filter);
+            }
+
+            // Collect files under $TUSCANY_HOME/lib
+            File libDirectory = new File(directoryFile, "lib");
+            URL libDirectoryURL = libDirectory.toURI().toURL(); 
+            if (!jarDirectoryURLs.contains(libDirectoryURL) && libDirectory.exists())
{
+                jarDirectoryURLs.add(libDirectoryURL);
+                collectJARFiles(libDirectory, jarURLs, filter);
+            }
+        }
+    }
+
+    /**
      * Collect JAR files in the given directory
      * @param directory
      * @param urls

Added: incubator/tuscany/java/sca/tools/eclipse/plugins/core/exsd/runtimeLibraries.exsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/exsd/runtimeLibraries.exsd?rev=662674&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/exsd/runtimeLibraries.exsd (added)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/exsd/runtimeLibraries.exsd Tue Jun
 3 00:33:24 2008
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.apache.tuscany.sca.core">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.apache.tuscany.sca.core" id="runtimeLibraries" name="Tuscany
Runtime Libraries"/>
+      </appInfo>
+      <documentation>
+         [Enter description of this extension point.]
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="classpathContainer">
+      <complexType>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="class" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn=":org.eclipse.jdt.core.IClasspathContainer"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         [Enter the first release in which this extension point appears.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         [Enter extension point usage example here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         [Enter API information here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+</schema>

Added: incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/ClasspathUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/ClasspathUtil.java?rev=662674&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/ClasspathUtil.java
(added)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/ClasspathUtil.java
Tue Jun  3 00:33:24 2008
@@ -0,0 +1,71 @@
+/*
+ * 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.core.classpath;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+
+/**
+ * Utility functions handling the runtime classpath.
+ *
+ * @version $Rev: $ $Date: $
+ */
+public class ClasspathUtil {
+
+    private static final String TUSCANY_RUNTIME_LIBRARIES = "org.apache.tuscany.sca.core.runtimeLibraries";
+
+    /**
+     * Return the installed runtime classpath entries.
+     * 
+     * @return
+     * @throws CoreException
+     */
+    public static String installedRuntimeClasspath() throws CoreException {
+        
+        List<IClasspathEntry> classpathEntries = new ArrayList<IClasspathEntry>();

+        for (IExtension extension: Platform.getExtensionRegistry().getExtensionPoint(TUSCANY_RUNTIME_LIBRARIES).getExtensions())
{
+            for (IConfigurationElement configuration: extension.getConfigurationElements())
{
+                IClasspathContainer container = (IClasspathContainer)configuration.createExecutableExtension("class");
+                classpathEntries.addAll(Arrays.asList(container.getClasspathEntries()));
+            }
+        }
+        
+        String separator = System.getProperty("path.separator");
+        StringBuffer classpath = new StringBuffer();
+        for (int i = 0, n = classpathEntries.size(); i < n; i++) {
+            IClasspathEntry entry = classpathEntries.get(i);
+            if (i >0) {
+                classpath.append(separator);
+            }
+            classpath.append(entry.getPath().toFile().toURI().getPath());
+        }
+        
+        return classpath.toString();
+    }
+
+}

Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java?rev=662674&r1=662673&r2=662674&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java
(original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java
Tue Jun  3 00:33:24 2008
@@ -44,14 +44,10 @@
     private static final String TUSCANY_HOME = "TUSCANY_HOME";
     private static final String TUSCANY_SRC = "TUSCANY_SRC";
     
-    private static final String TUSCANY_FEATURE =
-        "features/org.apache.tuscany.sca.feature_1.2.0";
+    private static final String TUSCANY_FEATURE = "features/org.apache.tuscany.sca.feature_1.2.0";
     
-    private static final String TUSCANY_FEATURE_RUNTIME = TUSCANY_FEATURE +
-        "/runtime/apache-tuscany-sca-2.0-incubating-SNAPSHOT/" +
-        "tuscany-sca-2.0-incubating-SNAPSHOT"; 
-    private static final String TUSCANY_FEATURE_SRC = TUSCANY_FEATURE +
-        "/src/apache-tuscany-sca-2.0-incubating-SNAPSHOT-src.zip"; 
+    private static final String TUSCANY_FEATURE_RUNTIME = TUSCANY_FEATURE + "/runtime"; 
+    private static final String TUSCANY_FEATURE_SRC = TUSCANY_FEATURE + "/src"; 
 
     public TuscanyClasspathContainer() {
     }
@@ -62,17 +58,34 @@
         // Get the runtime location from the installed Tuscany feature
         IPath runtimePath = null;
         try {
-            //FIXME Need a better way to find the location of the Tuscany feature
+            
+            // Find the Tuscany distribution under the feature's runtime directory
+            // Typically runtime/distro-archive-name/un-archived-distro-dir
             URL url = FileLocator.toFileURL(Platform.getInstallLocation().getURL());
             File file = new File(url.toURI());
             file = new File(file, TUSCANY_FEATURE_RUNTIME);
             if (file.exists()) {
-                runtimePath = new Path(file.getPath());
+                File distro = null;
+                for (File f: file.listFiles()) {
+                    if (f.getName().contains("tuscany-sca")) {
+                        distro = f;
+                        break;
+                    }
+                }
+                if (distro != null) {
+                    for (File f: distro.listFiles()) {
+                        if (f.getName().contains("tuscany-sca")) {
+                            runtimePath = new Path(f.getPath());
+                            break;
+                        }
+                    }
+                }
             }
         } catch (Exception e) {
         }
 
         if (runtimePath == null) {
+
             // Try to get the location of the Tuscany binary distribution from
             // the TUSCANY_HOME property or environment variable
             String home = System.getProperty(TUSCANY_HOME);
@@ -89,12 +102,23 @@
         // Get the source location from the installed Tuscany feature
         IPath sourcePath = null;
         try {
-            //FIXME Need a better way to find the location of the Tuscany feature
+
+            // Find the Tuscany source distribution under the feature's src directory
+            // Typically src/distro-archive-src.zip
             URL url = FileLocator.toFileURL(Platform.getInstallLocation().getURL());
             File file = new File(url.toURI());
             file = new File(file, TUSCANY_FEATURE_SRC);
             if (file.exists()) {
-                sourcePath = new Path(file.getPath());
+                File distro = null;
+                for (File f: file.listFiles()) {
+                    if (f.getName().contains("tuscany-sca") && f.getName().endsWith("-src.zip"))
{
+                        distro = f;
+                        break;
+                    }
+                }
+                if (distro != null) {
+                    sourcePath = new Path(distro.getPath());
+                }
             }
         } catch (Exception e) {
         }
@@ -117,7 +141,7 @@
         // Add the JARs from runtime/lib and runtime/modules as classpath entries
         if (runtimePath != null) {
             
-            // Add the jars from runtime/modules
+            // Add a selection of the jars from runtime/modules
             File modulesDirectory = runtimePath.append("modules").toFile();
             if (modulesDirectory != null && modulesDirectory.exists()) {
                 for (File file : modulesDirectory.listFiles()) {

Added: incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyRuntimeClasspathContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyRuntimeClasspathContainer.java?rev=662674&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyRuntimeClasspathContainer.java
(added)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyRuntimeClasspathContainer.java
Tue Jun  3 00:33:24 2008
@@ -0,0 +1,116 @@
+/*
+ * 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.core.classpath;
+
+import java.io.File;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.JavaCore;
+
+/**
+ * A classpath container for the Tuscany runtime.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class TuscanyRuntimeClasspathContainer implements IClasspathContainer {
+    
+    public static final IPath TUSCANY_LIBRARY_CONTAINER = new Path("org.apache.tuscany.sca.runtime.library");
 
+    
+    private static final String TUSCANY_HOME = "TUSCANY_HOME";
+    
+    private static final String TUSCANY_FEATURE = "features/org.apache.tuscany.sca.feature_1.2.0";
+    
+    private static final String TUSCANY_FEATURE_RUNTIME = TUSCANY_FEATURE + "/runtime"; 
+
+    public TuscanyRuntimeClasspathContainer() {
+    }
+
+    public IClasspathEntry[] getClasspathEntries() {
+        
+        // Get the runtime location from the installed Tuscany feature
+        IPath runtimePath = null;
+        try {
+            
+            // Find the Tuscany distribution under the feature's runtime directory
+            // Typically runtime/distro-archive-name/un-archived-distro-dir
+            URL url = FileLocator.toFileURL(Platform.getInstallLocation().getURL());
+            File file = new File(url.toURI());
+            file = new File(file, TUSCANY_FEATURE_RUNTIME);
+            if (file.exists()) {
+                File distro = null;
+                for (File f: file.listFiles()) {
+                    if (f.getName().contains("tuscany-sca")) {
+                        distro = f;
+                        break;
+                    }
+                }
+                if (distro != null) {
+                    for (File f: distro.listFiles()) {
+                        if (f.getName().contains("tuscany-sca")) {
+                            runtimePath = new Path(f.getPath());
+                            break;
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+        }
+
+        if (runtimePath == null) {
+
+            // Try to get the location of the Tuscany binary distribution from
+            // the TUSCANY_HOME property or environment variable
+            String home = System.getProperty(TUSCANY_HOME);
+            if (home == null || home.length() == 0) {
+                home = System.getenv(TUSCANY_HOME);
+            }
+            if (home != null && home.length() != 0) {
+                if (new File(home).exists()) {
+                    runtimePath = new Path(home);
+                }
+            }
+        }
+        
+        if (runtimePath != null) {
+            return new IClasspathEntry[] {JavaCore.newLibraryEntry(runtimePath, null, null)};
+        } else {
+            return new IClasspathEntry[0];
+        }
+    }
+
+    public String getDescription() {
+        return "Tuscany Library";
+    }
+
+    public int getKind() {
+        return IClasspathContainer.K_APPLICATION;
+    }
+
+    public IPath getPath() {
+        return TUSCANY_LIBRARY_CONTAINER;
+    }
+
+}

Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/DomainManagerLauncherUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/DomainManagerLauncherUtil.java?rev=662674&r1=662673&r2=662674&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/DomainManagerLauncherUtil.java
(original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/DomainManagerLauncherUtil.java
Tue Jun  3 00:33:24 2008
@@ -28,6 +28,7 @@
 import java.io.OutputStream;
 import java.net.Socket;
 
+import org.apache.tuscany.sca.core.classpath.ClasspathUtil;
 import org.apache.tuscany.sca.core.classpath.TuscanyClasspathContainer;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
@@ -55,7 +56,7 @@
  * @version $Rev: $ $Date: $
  */
 public class DomainManagerLauncherUtil {
-
+    
     private static final String TUSCANY_DOMAIN_LAUNCH_CONFIGURATION = "SCA Domain Manager";
     private static final String TUSCANY_SCA_DOMAIN_PROJECT = "tuscany-sca-domain";
 
@@ -201,6 +202,9 @@
                 newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
domainProject.getProject().getName());
                 newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
"org.apache.tuscany.sca.node.launcher.DomainManagerLauncher");
                 newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
domainProject.getLocation().toString());
+                
+                // Pass the runtime classpath as a system property
+                newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
"-DTUSCANY_PATH=" + ClasspathUtil.installedRuntimeClasspath());
 
                 // Save the configuration
                 newConfiguration.doSave();

Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/NodeLauncherUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/NodeLauncherUtil.java?rev=662674&r1=662673&r2=662674&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/NodeLauncherUtil.java
(original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/NodeLauncherUtil.java
Tue Jun  3 00:33:24 2008
@@ -28,6 +28,7 @@
 import java.net.MalformedURLException;
 import java.net.Socket;
 
+import org.apache.tuscany.sca.core.classpath.ClasspathUtil;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
@@ -128,7 +129,10 @@
             
             // Save the composite path in the launch configuration
             newConfiguration.setAttribute("COMPOSITE_PATH", file.getFullPath().toString());
-            
+
+            // Pass the runtime classpath as a system property
+            newConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
"-DTUSCANY_PATH=" + ClasspathUtil.installedRuntimeClasspath());
+
             // Save the configuration
             newConfiguration.doSave();
 

Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/plugin.xml?rev=662674&r1=662673&r2=662674&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/plugin.xml (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/plugin.xml Tue Jun  3 00:33:24 2008
@@ -20,6 +20,10 @@
 -->
 <plugin>
 
+	<extension-point id="runtimeLibraries"
+		name="Tuscany Runtime Libraries"
+		schema="exsd/runtimeLibraries.exsd"/>
+
 	<extension point = "org.eclipse.wst.xml.core.catalogContributions">
 		<catalogContribution id="default">
 			<uri name="http://www.osoa.org/xmlns/sca/1.0" uri="xsd/sca-all.xsd"/>
@@ -37,6 +41,13 @@
       <file-association content-type="org.eclipse.core.runtime.xml" file-extensions="componentType"/>
      
 	</extension>
 	
+	<extension
+       point="org.apache.tuscany.sca.core.runtimeLibraries">
+    	<classpathContainer 
+    			id="org.apache.tuscany.sca.runtime.library"
+				class="org.apache.tuscany.sca.core.classpath.TuscanyRuntimeClasspathContainer"/> 
                     
+	</extension>	
+
 	<extension point="org.eclipse.jdt.core.classpathContainerInitializer">
     	<classpathContainerInitializer 
     			id="org.apache.tuscany.sca.runtime.library"
@@ -133,6 +144,6 @@
 				id="org.apache.tuscany.sca.core.newwizards.newcompositewizard">
 			<description>Create a new SCA ComponentType</description> 
 		</wizard>		
-	</extension>	
-
+	</extension>
+	
 </plugin>



Mime
View raw message