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/21 21:48:30 UTC
svn commit: r639824 - in /incubator/tuscany/java/sca/tools/eclipse: ./
features/feature/ plugins/core/ plugins/core/.settings/
plugins/core/META-INF/ plugins/core/org/
plugins/core/org/apache/tuscany/sca/core/classpath/
plugins/core/org/apache/tuscany/...
Author: jsdelfino
Date: Fri Mar 21 13:48:27 2008
New Revision: 639824
URL: http://svn.apache.org/viewvc?rev=639824&view=rev
Log:
Fixed plugin build to produce correct plugin JARs. Ported the plugin to use the latest node2 launcher.
Added:
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/
- copied from r639302, incubator/tuscany/java/sca/tools/eclipse/plugins/core/src/main/java/org/
incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-contribution.xsd (with props)
incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd (with props)
Removed:
incubator/tuscany/java/sca/tools/eclipse/plugins/core/.settings/
incubator/tuscany/java/sca/tools/eclipse/plugins/core/src/
incubator/tuscany/java/sca/tools/eclipse/plugins/runtime/
Modified:
incubator/tuscany/java/sca/tools/eclipse/features/feature/feature.xml
incubator/tuscany/java/sca/tools/eclipse/plugins/core/.classpath
incubator/tuscany/java/sca/tools/eclipse/plugins/core/.project
incubator/tuscany/java/sca/tools/eclipse/plugins/core/META-INF/MANIFEST.MF
incubator/tuscany/java/sca/tools/eclipse/plugins/core/build.properties
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/TuscanyLaunchConfigurationDelegate.java
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/TuscanyLaunchShortcut.java
incubator/tuscany/java/sca/tools/eclipse/plugins/core/pom.xml
incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-all.xsd
incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-atom.xsd
incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rss.xsd
incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-node.xsd
incubator/tuscany/java/sca/tools/eclipse/pom.xml
incubator/tuscany/java/sca/tools/eclipse/site/updatesite/pom.xml
incubator/tuscany/java/sca/tools/eclipse/site/updatesite/site.xml
incubator/tuscany/java/sca/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml
Modified: incubator/tuscany/java/sca/tools/eclipse/features/feature/feature.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/features/feature/feature.xml?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/features/feature/feature.xml (original)
+++ incubator/tuscany/java/sca/tools/eclipse/features/feature/feature.xml Fri Mar 21 13:48:27 2008
@@ -20,7 +20,7 @@
<feature
id="org.apache.tuscany.sca.feature"
label="Apache Tuscany SCA Tools"
- version="1.1.0"
+ version="1.2.0"
provider-name="Apache Software Foundation">
<description url="http://incubator.apache.org/tuscany">
@@ -55,13 +55,7 @@
id="org.apache.tuscany.sca.core"
download-size="0"
install-size="0"
- version="1.1.0"
+ version="1.2.0"
unpack="false"/>
-
- <plugin
- id="org.apache.tuscany.sca.runtime"
- download-size="0"
- install-size="0"
- version="1.1.0"/>
</feature>
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/.classpath
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/.classpath?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/.classpath (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/.classpath Fri Mar 21 13:48:27 2008
@@ -1,6 +1,5 @@
<classpath>
- <classpathentry kind="src" path="." excluding="**/*.java|**/.*/**|pom.xml|build.*|**/*.java"/>
- <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="."/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/debug/ui/3.2.100-v20070531-1800/ui-3.2.100-v20070531-1800.jar"/>
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/.project
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/.project?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/.project (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/.project Fri Mar 21 13:48:27 2008
@@ -6,24 +6,8 @@
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
</buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- </buildCommand>
</buildSpec>
<natures>
- <nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
</natures>
</projectDescription>
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/META-INF/MANIFEST.MF?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/META-INF/MANIFEST.MF (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/META-INF/MANIFEST.MF Fri Mar 21 13:48:27 2008
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Apache Tuscany SCA Tools
Bundle-SymbolicName: org.apache.tuscany.sca.core;singleton:=true
-Bundle-Version: 1.1.0
+Bundle-Version: 1.2.0
Import-Package: org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.core.runtime.jobs,
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/build.properties
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/build.properties?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/build.properties (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/build.properties Fri Mar 21 13:48:27 2008
@@ -6,10 +6,10 @@
.,\
DISCLAIMER,\
LICENSE,\
- NOTICE
+ NOTICE,\
+ org/
src.includes = xsd/,\
plugin.xml,\
- src/,\
.classpath,\
.project,\
DISCLAIMER,\
@@ -18,7 +18,8 @@
NOTICE,\
build.properties,\
icons/,\
- target/,\
- .settings/
+ .settings/,\
+ org/,\
+ pom.xml
jars.compile.order = .
-source.. = src/main/java/
+source.. = .
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=639824&r1=639302&r2=639824&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 Fri Mar 21 13:48:27 2008
@@ -20,15 +20,11 @@
package org.apache.tuscany.sca.core.classpath;
import java.io.File;
-import java.io.IOException;
-import java.net.URL;
import java.util.ArrayList;
import java.util.List;
-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;
@@ -39,43 +35,63 @@
* @version $Rev$ $Date$
*/
public class TuscanyClasspathContainer implements IClasspathContainer {
+
+ private static final String TUSCANY_HOME = "TUSCANY_HOME";
+ private static final String TUSCANY_SRC = "TUSCANY_SRC";
public TuscanyClasspathContainer() {
}
public IClasspathEntry[] getClasspathEntries() {
+ List<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
// Get the runtime plugin location
- IPath runtimePath;
- try {
- URL url = FileLocator.toFileURL(Platform.getBundle("org.apache.tuscany.sca.runtime").getEntry("/"));
- runtimePath = new Path(url.getFile());
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
+// IPath runtimePath;
+// try {
+// URL url = FileLocator.toFileURL(Platform.getBundle("org.apache.tuscany.sca.runtime").getEntry("/"));
+// runtimePath = new Path(url.getFile());
+// } catch (IOException e) {
+// throw new IllegalArgumentException(e);
+// }
- // Add Jars from runtime/lib as classpath entries
- List<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- for (File file : runtimePath.append("lib").toFile().listFiles()) {
- IPath path = new Path(file.getPath());
- if (!"jar".equals(path.getFileExtension())) {
- continue;
+ // Get the location of the Tuscany binary distribution from
+ // the TUSCANY_SOURCE 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) {
+ IPath runtimePath = new Path(home);
+
+ // Get the location of the Tuscany source distribution from
+ // the TUSCANY_SOURCE property or environment variable
+ String source = System.getProperty(TUSCANY_SRC);
+ if (source == null || source.length() == 0) {
+ source = System.getenv(TUSCANY_SRC);
+ }
+ IPath sourcePath;
+ if (source != null && source.length() != 0) {
+ sourcePath = new Path(source);
+ } else {
+ sourcePath = null;
+ }
+
+ // Add JARs from runtime/lib and runtime/modules as classpath entries
+ for (String directory: new String[]{"modules", "lib"}) {
+ File parent = runtimePath.append(directory).toFile();
+ if (parent != null && parent.exists()) {
+ for (File file : parent.listFiles()) {
+ IPath path = new Path(file.getPath());
+ String extension = path.getFileExtension();
+ if (!"jar".equals(extension)) {
+ continue;
+ }
+ list.add(JavaCore.newLibraryEntry(path, sourcePath, null));
+ }
+ }
}
- if (path.lastSegment().equals("tuscany-sca-all-1.0-incubating.jar")) {
- IPath sourcePath =
- runtimePath.append("src/apache-tuscany-sca-1.0-incubating-src.zip");
- list.add(JavaCore.newLibraryEntry(path, sourcePath, null));
- } else if (path.lastSegment().equals("tuscany-sca-all-1.1-incubating-SNAPSHOT.jar")) {
- IPath sourcePath =
- runtimePath.append("src/apache-tuscany-sca-1.1-incubating-SNAPSHOT-src.zip");
- list.add(JavaCore.newLibraryEntry(path, sourcePath, null));
- } else if (path.lastSegment().equals("tuscany-sca-all-1.2-incubating-SNAPSHOT.jar")) {
- IPath sourcePath =
- runtimePath.append("src/apache-tuscany-sca-1.2-incubating-SNAPSHOT-src.zip");
- list.add(JavaCore.newLibraryEntry(path, sourcePath, null));
- } else
- list.add(JavaCore.newLibraryEntry(path, null, null));
}
+
return (IClasspathEntry[])list.toArray(new IClasspathEntry[list.size()]);
}
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/TuscanyLaunchConfigurationDelegate.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/TuscanyLaunchConfigurationDelegate.java?rev=639824&r1=639302&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/TuscanyLaunchConfigurationDelegate.java (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/TuscanyLaunchConfigurationDelegate.java Fri Mar 21 13:48:27 2008
@@ -22,8 +22,11 @@
import java.io.File;
import java.util.Map;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
@@ -32,6 +35,7 @@
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.IVMRunner;
import org.eclipse.jdt.launching.VMRunnerConfiguration;
+import org.osgi.framework.Bundle;
/**
* Launch configuration delegate for the Tuscany launch configuration.
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/TuscanyLaunchShortcut.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/TuscanyLaunchShortcut.java?rev=639824&r1=639302&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/TuscanyLaunchShortcut.java (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/launch/TuscanyLaunchShortcut.java Fri Mar 21 13:48:27 2008
@@ -20,13 +20,21 @@
package org.apache.tuscany.sca.core.launch;
import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
+import java.net.MalformedURLException;
import java.net.Socket;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
@@ -47,6 +55,8 @@
* @version $Rev$ $Date$
*/
public class TuscanyLaunchShortcut implements ILaunchShortcut {
+
+ private final static String TUSCANY_SCA_DOMAIN_PROJECT = "tuscany-sca-domain";
public void launch(ISelection selection, String mode) {
@@ -71,8 +81,11 @@
"org.apache.tuscany.sca.core.launch.configurationtype");
// If the SCA domain controller is not running yet, launch it
- if (!isDomainControllerRunning()) {
- launchDomainController(mode, file, launchManager, launchConfigurationType);
+ if (!isDomainManagerRunning()) {
+ launchDomainManager(mode, file, launchManager, launchConfigurationType);
+ if (!waitForDomainManager()) {
+ throw new RuntimeException("SCA Domain Manager could not be started.");
+ }
}
// Launch an SCA node
@@ -100,32 +113,32 @@
private void launchNode(String mode,
IFile file,
ILaunchManager launchManager,
- ILaunchConfigurationType launchConfigurationType) throws CoreException, JavaModelException {
+ ILaunchConfigurationType launchConfigurationType) throws CoreException, JavaModelException, IOException {
+
+ // Get the Java project
+ IJavaProject javaProject = JavaCore.create(file.getProject());
+ // Get the contribution location and URI
+ String contributionLocation = contributionLocation(javaProject);
+ String contributionURI = contributionURI(javaProject);
+
+ // Determine the composite file URI
+ String compositeURI = compositeURI(javaProject, file);
+
+ // Configure the node
+ String nodeName = configureNode(contributionURI, contributionLocation, compositeURI);
+
// Create a launch configuration
ILaunchConfigurationWorkingCopy configuration = launchConfigurationType.newInstance(null,
launchManager.generateUniqueLaunchConfigurationNameFrom(file.getFullPath().removeFileExtension().lastSegment()));
- // Get the Java project
- IJavaProject javaProject = JavaCore.create(file.getProject());
-
// Set the project and type to launch
- configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.apache.tuscany.sca.node.launch.SCANodeLauncher");
+ configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.apache.tuscany.sca.node.launcher.NodeLauncher");
configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, file.getProject().getName());
- // Find the Java source container containing the selected .composite file
- IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
- int sourceFolderSegments = 0;
- for (IClasspathEntry entry : classpathEntries)
- if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- sourceFolderSegments = entry.getPath().matchingFirstSegments(file.getFullPath());
- if (sourceFolderSegments > 0)
- break;
- }
-
- // Pass the path of the .composite relative to the source folder to the launcher
+ // Pass the URL of the node install image to the launcher
configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
- file.getFullPath().removeFirstSegments(sourceFolderSegments).toString());
+ "http://localhost:9990/node-image/" + nodeName);
// Save the configuration
configuration.doSave();
@@ -135,7 +148,7 @@
}
/**
- * Launch the SCA domain controller.
+ * Launch the SCA domain manager.
*
* @param mode
* @param launchManager
@@ -143,18 +156,22 @@
* @throws CoreException
* @throws JavaModelException
*/
- private void launchDomainController(String mode,
+ private void launchDomainManager(String mode,
IFile file,
ILaunchManager launchManager,
ILaunchConfigurationType launchConfigurationType) throws CoreException, JavaModelException {
+
+ // Get the SCA domain project
+ IProject domainProject = domainProject();
// Create a launch configuration
ILaunchConfigurationWorkingCopy configuration = launchConfigurationType.newInstance(null,
- launchManager.generateUniqueLaunchConfigurationNameFrom("Tuscany Domain Controller"));
+ launchManager.generateUniqueLaunchConfigurationNameFrom("Apache Tuscany SCA Domain Manager"));
// Set the project and type to launch
configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, file.getProject().getName());
- configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.apache.tuscany.sca.domain.launch.SCADomainControllerLauncher");
+ configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "org.apache.tuscany.sca.node.launcher.DomainNodeLauncher");
+ configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, domainProject.getLocation().toString());
// Save the configuration
configuration.doSave();
@@ -164,7 +181,7 @@
}
private static final String PING_HEADER =
- "GET /domain/index.html HTTP/1.0\n" + "Host: localhost\n"
+ "GET /ping HTTP/1.0\n" + "Host: localhost\n"
+ "Content-Type: text/xml\n"
+ "Connection: close\n"
+ "Content-Length: ";
@@ -177,14 +194,14 @@
*
* @return
*/
- private boolean isDomainControllerRunning() {
+ private static boolean isDomainManagerRunning() {
try {
- Socket client = new Socket("localhost", 9999);
+ Socket client = new Socket("localhost", 9990);
OutputStream os = client.getOutputStream();
os.write(PING.getBytes());
os.flush();
String response = read(client);
- if (response.indexOf("Tuscany") != -1) {
+ if (response.indexOf("<span id=\"ping\">") != -1) {
return true;
} else {
return false;
@@ -195,6 +212,21 @@
}
/**
+ * Wait for domain to be running.
+ *
+ * @return
+ */
+ private static boolean waitForDomainManager() throws InterruptedException {
+ for (int i = 0; i < 30; i++) {
+ if (isDomainManagerRunning()) {
+ return true;
+ }
+ Thread.sleep(500);
+ }
+ return false;
+ }
+
+ /**
* Read a String from a socket.
*
* @param socket
@@ -218,4 +250,136 @@
}
}
+ /**
+ * Returns the location of the SCA contribution representing a Java project.
+ * @param javaProject
+ * @return
+ * @throws MalformedURLException
+ * @throws JavaModelException
+ */
+ private static String contributionLocation(IJavaProject javaProject) throws MalformedURLException, JavaModelException {
+ IPath location = javaProject.getOutputLocation();
+ IResource resource;
+ if (location.segmentCount() == 1) {
+ resource = javaProject.getProject();
+ } else {
+ resource = javaProject.getProject().getWorkspace().getRoot().getFolder(location);
+ }
+ location = resource.getLocation();
+ String url = location.toFile().toURI().toURL().toString();
+ if (url.endsWith("/")) {
+ url = url.substring(0, url.length() - 1);
+ }
+ return url;
+ }
+
+ /**
+ * Returns the URI of the SCA contribution representing a Java project.
+ * @param javaProject
+ * @return
+ */
+ private static String contributionURI(IJavaProject javaProject) {
+ return javaProject.getProject().getName();
+ }
+
+ /**
+ * Returns the SCA artifact URI of a composite file inside a Java project.
+ *
+ * @param javaProject
+ * @param file
+ * @return
+ * @throws JavaModelException
+ */
+ private static String compositeURI(IJavaProject javaProject, IFile file) throws JavaModelException {
+
+ // Find the Java source container containing the specified file
+ IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
+ int sourceFolderSegments = 0;
+ for (IClasspathEntry entry : classpathEntries) {
+ if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+ sourceFolderSegments = entry.getPath().matchingFirstSegments(file.getFullPath());
+ if (sourceFolderSegments > 0)
+ break;
+ }
+ }
+
+ // Determine the composite URI
+ String compositeURI = file.getFullPath().removeFirstSegments(sourceFolderSegments).toString();
+ return compositeURI;
+ }
+
+ private static final String START_HEADER1 =
+ "GET /quickstart?";
+ private static final String START_HEADER2 =
+ " HTTP/1.0\n" + "Host: localhost\n"
+ + "Content-Type: text/xml\n"
+ + "Connection: close\n"
+ + "Content-Length: ";
+ private static final String START_CONTENT = "";
+
+ /**
+ * Send a request to the SCA domain manager to configure an SCA node for
+ * the specified composite.
+ *
+ * @param contributionURI
+ * @param contributionLocation
+ * @param compositeURI
+ * @return
+ * @throws IOException
+ */
+ private static String configureNode(String contributionURI, String contributionLocation, String compositeURI) throws IOException, CoreException {
+
+ // Send the request to configure the node
+ Socket client = new Socket("localhost", 9990);
+ OutputStream os = client.getOutputStream();
+ String request = START_HEADER1 +
+ "contribution=" + contributionURI + "&location=" + contributionLocation + "&composite=" + compositeURI +
+ START_HEADER2 + START_CONTENT.getBytes().length + "\n\n" + START_CONTENT;
+ os.write(request.getBytes());
+ os.flush();
+ String response = read(client);
+
+ // Refresh the domain project
+ domainProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+
+ int i = response.indexOf("<span id=\"node\">");
+ if (i != -1) {
+
+ // Extract the node name
+ response = response.substring(i + 16);
+ i = response.indexOf("</span>");
+ String nodeName = response.substring(0, i);
+ return nodeName;
+
+ } else {
+ throw new RuntimeException("Node could not be configured: " + response);
+ }
+ }
+
+ /**
+ * Returns the SCA domain project.
+ *
+ * @return
+ * @throws CoreException
+ */
+ private static IProject domainProject() throws CoreException {
+ IProject domainProject = ResourcesPlugin.getWorkspace().getRoot().getProject(TUSCANY_SCA_DOMAIN_PROJECT);
+ if (!domainProject.exists()) {
+ domainProject.create(new NullProgressMonitor());
+ domainProject.open(new NullProgressMonitor());
+
+ String html = "<html>\n" +
+ "<head>\n" +
+ "<meta http-equiv=\"refresh\" content=\"0;url=http://localhost:9990/ui/home\">\n" +
+ "</head>\n" +
+ "<body>\n" +
+ "<a href=\"http://localhost:9990/ui/home\">SCA Domain</a>\n" +
+ "</body>\n" +
+ "</html>";
+
+ IFile file = domainProject.getFile(new Path("domain.html"));
+ file.create(new ByteArrayInputStream(html.getBytes()), true, new NullProgressMonitor());
+ }
+ return domainProject;
+ }
}
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/pom.xml?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/pom.xml (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/pom.xml Fri Mar 21 13:48:27 2008
@@ -42,6 +42,7 @@
</dependencies>
<build>
+ <sourceDirectory>${basedir}</sourceDirectory>
<resources>
<resource>
<directory>${basedir}</directory>
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-all.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-all.xsd?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-all.xsd (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-all.xsd Fri Mar 21 13:48:27 2008
@@ -23,9 +23,12 @@
<include schemaLocation="sca.xsd"/>
+ <include schemaLocation="sca-contribution.xsd"/>
+
<include schemaLocation="sca-binding-ejb.xsd"/>
<include schemaLocation="sca-implementation-bpel.xsd"/>
<include schemaLocation="sca-implementation-spring.xsd"/>
+ <include schemaLocation="sca-implementation-ejb.xsd"/>
</schema>
Added: incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-contribution.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-contribution.xsd?rev=639824&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-contribution.xsd (added)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-contribution.xsd Fri Mar 21 13:48:27 2008
@@ -0,0 +1,38 @@
+<?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.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core.xsd"/>
+
+ <element name="contribution" type="sca:Contribution"/>
+
+ <complexType name="Contribution">
+ <sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <any namespace="##any" processContents="lax"/>
+ </choice>
+ </sequence>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+</schema>
\ No newline at end of file
Propchange: incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-contribution.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-contribution.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd?rev=639824&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd (added)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd Fri Mar 21 13:48:27 2008
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- (c) Copyright SCA Collaboration 2006 -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core.xsd"/>
+
+ <element name="implementation.ejb" type="sca:EJBImplementation"
+ substitutionGroup="sca:implementation"/>
+ <complexType name="EJBImplementation">
+ <complexContent>
+ <extension base="sca:Implementation">
+ <sequence>
+ <any namespace="##other" processContents="lax"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <!-- we might want to make this refer to the JEE ejb-link type -->
+ <attribute name="ejb-link" type="token" use="required"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
\ No newline at end of file
Propchange: incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/sca-implementation-ejb.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-atom.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-atom.xsd?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-atom.xsd (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-atom.xsd Fri Mar 21 13:48:27 2008
@@ -34,6 +34,7 @@
<any namespace="##targetNamespace" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
+ <attribute name="title" type="string" use="optional"/>
</extension>
</complexContent>
</complexType>
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rss.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rss.xsd?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rss.xsd (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-binding-rss.xsd Fri Mar 21 13:48:27 2008
@@ -34,6 +34,7 @@
<any namespace="##targetNamespace" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
</sequence>
+ <attribute name="title" type="string" use="optional"/>
</extension>
</complexContent>
</complexType>
Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-node.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-node.xsd?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-node.xsd (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/xsd/tuscany-sca-implementation-node.xsd Fri Mar 21 13:48:27 2008
@@ -34,6 +34,7 @@
<any namespace="##targetNamespace" processContents="lax"
minOccurs="0" maxOccurs="unbounded"/>
</sequence>
+ <attribute name="uri" type="string" use="required"/>
<attribute name="composite" type="QName" use="required"/>
</extension>
</complexContent>
Modified: incubator/tuscany/java/sca/tools/eclipse/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/pom.xml?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/pom.xml (original)
+++ incubator/tuscany/java/sca/tools/eclipse/pom.xml Fri Mar 21 13:48:27 2008
@@ -39,7 +39,6 @@
<modules>
<module>features/feature</module>
<module>plugins/core</module>
- <module>plugins/runtime</module>
<module>site/updatesite</module>
</modules>
</profile>
Modified: incubator/tuscany/java/sca/tools/eclipse/site/updatesite/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/site/updatesite/pom.xml?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/site/updatesite/pom.xml (original)
+++ incubator/tuscany/java/sca/tools/eclipse/site/updatesite/pom.xml Fri Mar 21 13:48:27 2008
@@ -38,11 +38,6 @@
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>org.apache.tuscany.sca.runtime</artifactId>
- <version>2.0-incubating-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
<artifactId>org.apache.tuscany.sca.feature</artifactId>
<version>2.0-incubating-SNAPSHOT</version>
</dependency>
Modified: incubator/tuscany/java/sca/tools/eclipse/site/updatesite/site.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/site/updatesite/site.xml?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/site/updatesite/site.xml (original)
+++ incubator/tuscany/java/sca/tools/eclipse/site/updatesite/site.xml Fri Mar 21 13:48:27 2008
@@ -3,5 +3,5 @@
<description url="http://people.apache.org/~jsdelfino/tuscany/tools/updatesite">
Apache Tuscany SCA Tools.
</description>
- <feature url="features/org.apache.tuscany.sca.feature_1.1.0.jar" id="org.apache.tuscany.sca.feature" version="1.1.0"/>
+ <feature url="features/org.apache.tuscany.sca.feature_1.2.0.jar" id="org.apache.tuscany.sca.feature" version="1.2.0"/>
</site>
Modified: incubator/tuscany/java/sca/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml?rev=639824&r1=639823&r2=639824&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml (original)
+++ incubator/tuscany/java/sca/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml Fri Mar 21 13:48:27 2008
@@ -41,7 +41,6 @@
<unpack>false</unpack>
<includes>
<include>org.apache.tuscany.sca:org.apache.tuscany.sca.core</include>
- <include>org.apache.tuscany.sca:org.apache.tuscany.sca.runtime</include>
</includes>
<scope>runtime</scope>
<outputFileNameMapping>${artifactId}_1.1.0.${extension}</outputFileNameMapping>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org