summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sandbox/slaws/runtimecompat/1xcalculator.jarbin0 -> 9201 bytes
-rw-r--r--sandbox/slaws/runtimecompat/1xlauncher/pom.xml62
-rw-r--r--sandbox/slaws/runtimecompat/1xlauncher/src/main/java/launcher/OneXLauncher.java36
-rw-r--r--sandbox/slaws/runtimecompat/2xcalculator.jarbin0 -> 11573 bytes
-rw-r--r--sandbox/slaws/runtimecompat/2xlauncher/pom.xml63
-rw-r--r--sandbox/slaws/runtimecompat/2xlauncher/src/main/java/launcher/TwoXLauncher.java38
-rw-r--r--sandbox/slaws/runtimecompat/combinedlauncher/pom.xml61
-rw-r--r--sandbox/slaws/runtimecompat/combinedlauncher/src/main/java/launcher/CombinedLauncher.java131
-rw-r--r--sandbox/slaws/runtimecompat/pom.xml65
9 files changed, 456 insertions, 0 deletions
diff --git a/sandbox/slaws/runtimecompat/1xcalculator.jar b/sandbox/slaws/runtimecompat/1xcalculator.jar
new file mode 100644
index 0000000000..f8360d18dd
--- /dev/null
+++ b/sandbox/slaws/runtimecompat/1xcalculator.jar
Binary files differ
diff --git a/sandbox/slaws/runtimecompat/1xlauncher/pom.xml b/sandbox/slaws/runtimecompat/1xlauncher/pom.xml
new file mode 100644
index 0000000000..ba1cd04311
--- /dev/null
+++ b/sandbox/slaws/runtimecompat/1xlauncher/pom.xml
@@ -0,0 +1,62 @@
+<?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-sca</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>1x-launcher</artifactId>
+ <name>Apache Tuscany SCA 1.x Launcher</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-node-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/sandbox/slaws/runtimecompat/1xlauncher/src/main/java/launcher/OneXLauncher.java b/sandbox/slaws/runtimecompat/1xlauncher/src/main/java/launcher/OneXLauncher.java
new file mode 100644
index 0000000000..251e5f1ff6
--- /dev/null
+++ b/sandbox/slaws/runtimecompat/1xlauncher/src/main/java/launcher/OneXLauncher.java
@@ -0,0 +1,36 @@
+/*
+ * 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 launcher;
+
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+
+public class OneXLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCANode node = SCANodeFactory.newInstance().createSCANode("Calculator.composite",
+ new SCAContribution("calculator", "../1xcalculator.jar"));
+
+ node.start();
+
+ node.stop();
+ }
+}
diff --git a/sandbox/slaws/runtimecompat/2xcalculator.jar b/sandbox/slaws/runtimecompat/2xcalculator.jar
new file mode 100644
index 0000000000..366d57811f
--- /dev/null
+++ b/sandbox/slaws/runtimecompat/2xcalculator.jar
Binary files differ
diff --git a/sandbox/slaws/runtimecompat/2xlauncher/pom.xml b/sandbox/slaws/runtimecompat/2xlauncher/pom.xml
new file mode 100644
index 0000000000..e233ea16d4
--- /dev/null
+++ b/sandbox/slaws/runtimecompat/2xlauncher/pom.xml
@@ -0,0 +1,63 @@
+<?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-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+ <version>1.0-SNAPSHOT</version>
+ <artifactId>2x-launcher</artifactId>
+ <name>Apache Tuscany SCA 2.x Launcher</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/sandbox/slaws/runtimecompat/2xlauncher/src/main/java/launcher/TwoXLauncher.java b/sandbox/slaws/runtimecompat/2xlauncher/src/main/java/launcher/TwoXLauncher.java
new file mode 100644
index 0000000000..128617cb32
--- /dev/null
+++ b/sandbox/slaws/runtimecompat/2xlauncher/src/main/java/launcher/TwoXLauncher.java
@@ -0,0 +1,38 @@
+/*
+ * 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 launcher;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+
+public class TwoXLauncher {
+
+ public static void main(String[] args) throws Exception {
+ Node node = NodeFactory.newInstance().createNode("Calculator.composite",
+ new Contribution("calculator", "../2xcalculator.jar"));
+
+ node.start();
+
+
+ node.stop();
+ }
+}
diff --git a/sandbox/slaws/runtimecompat/combinedlauncher/pom.xml b/sandbox/slaws/runtimecompat/combinedlauncher/pom.xml
new file mode 100644
index 0000000000..93c9b2652e
--- /dev/null
+++ b/sandbox/slaws/runtimecompat/combinedlauncher/pom.xml
@@ -0,0 +1,61 @@
+<?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-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+ <version>1.0-SNAPSHOT</version>
+ <artifactId>combined-launcher</artifactId>
+ <name>Apache Tuscany SCA Combined Launcher</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency -->
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/sandbox/slaws/runtimecompat/combinedlauncher/src/main/java/launcher/CombinedLauncher.java b/sandbox/slaws/runtimecompat/combinedlauncher/src/main/java/launcher/CombinedLauncher.java
new file mode 100644
index 0000000000..f21284716f
--- /dev/null
+++ b/sandbox/slaws/runtimecompat/combinedlauncher/src/main/java/launcher/CombinedLauncher.java
@@ -0,0 +1,131 @@
+/*
+ * 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 launcher;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+
+public class CombinedLauncher {
+
+ private static final String TWO_X_NODE_LAUNCHER_EQUINOX_BUNDLE = "org.apache.tuscany.sca.node.launcher.equinox";
+ private static final String TWO_X_NODE_LAUNCHER_UTIL = "org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil";
+ private static final String TWO_X_CONTRIBUTION = "org.apache.tuscany.sca.node.equinox.launcher.Contribution";
+
+ private static final String TWO_X_NODE_API_BUNDLE = "org.apache.tuscany.sca.node.api";
+ private static final String TWO_X_NODE = "org.apache.tuscany.sca.node.Node";
+
+ public static void main(String[] args) throws Exception {
+ // fire up the equinox host for the core set of Tuscany bundles
+ // enough to run the calculator sample
+
+ // set TUSCANY_HOME environment variable to get
+ // equinox host to load all the 2.x Tuscany
+ // bundles + dependencies
+ // Hack so that I don't have to remember to
+ // set the environment variable. Don't do this at home
+ System.setProperty("TUSCANY_HOME",
+ "../../../java-2.x/distribution/all/target/apache-tuscany-sca-all-2.0-SNAPSHOT-dir/tuscany-sca-2.0-SNAPSHOT");
+ EquinoxHost equinoxHost = new EquinoxHost();
+ BundleContext bundleContext = equinoxHost.start();
+
+ // need to add in the 1.x bundle(s) also
+ // TODO
+
+ // load 2xcalculator?
+ // find the the 2.x node launcher util
+ // Get the node runtime bundle.
+ Bundle bundle = null;
+ for (Bundle b : bundleContext.getBundles()) {
+ if (TWO_X_NODE_LAUNCHER_EQUINOX_BUNDLE.equals(b.getSymbolicName())) {
+ bundle = b;
+ break;
+ }
+ }
+ if (bundle == null) {
+ throw new IllegalStateException("Bundle " + TWO_X_NODE_LAUNCHER_EQUINOX_BUNDLE + " is not installed");
+ }
+
+ // All this reflection not strictly needed given the current
+ // module dependencies. Just experimenting
+ Class<?> contributionClass = bundle.loadClass(TWO_X_CONTRIBUTION);
+ Constructor<?> constructor = contributionClass.getConstructor(String.class, String.class);
+
+ Class<?> bootstrapClass = bundle.loadClass(TWO_X_NODE_LAUNCHER_UTIL);
+ Class<?> contributionArrayClass = Array.newInstance(contributionClass, 0).getClass();
+ Method nodeMethod = bootstrapClass.getMethod("node", String.class, String.class, String.class, contributionArrayClass, BundleContext.class);
+
+ bundle = null;
+ for (Bundle b : bundleContext.getBundles()) {
+ if (TWO_X_NODE_API_BUNDLE.equals(b.getSymbolicName())) {
+ bundle = b;
+ break;
+ }
+ }
+ if (bundle == null) {
+ throw new IllegalStateException("Bundle " + TWO_X_NODE_API_BUNDLE + " is not installed");
+ }
+
+ Class<?> nodeClass = bundle.loadClass(TWO_X_NODE);
+ Method startMethod = nodeClass.getMethod("start");
+
+ String configurationURI = null;
+ String compositeURI = null;
+ String compositeContent = null;
+ Object contribution = constructor.newInstance("calculator", "../2xcalculator.jar");
+ Object[] contributions = (Object[])Array.newInstance(contributionClass, 1);
+ contributions[0] = contribution;
+
+ Object node = nodeMethod.invoke(null,
+ configurationURI,
+ compositeURI,
+ compositeContent,
+ contributionArrayClass.cast(contributions),
+ bundleContext);
+
+ startMethod.invoke(node);
+
+ System.out.println("2.x Started");
+
+ // load 1xcalculator?
+ // find the the 1.x node launcher
+
+
+
+/*
+ Node node = NodeFactory.newInstance().createNode("Calculator.composite",
+ new Contribution("calculator", "../2xcalculator.jar"));
+
+ node.start();
+ node.stop();
+*/
+ equinoxHost.stop();
+ }
+
+
+}
diff --git a/sandbox/slaws/runtimecompat/pom.xml b/sandbox/slaws/runtimecompat/pom.xml
new file mode 100644
index 0000000000..6c781dffc5
--- /dev/null
+++ b/sandbox/slaws/runtimecompat/pom.xml
@@ -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-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-itest-runtime-compatibility</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Integration Test Runtime Compatibility</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>2.4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+
+ <profiles>
+
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>1xlauncher</module>
+ <module>2xlauncher</module>
+ <module>combinedlauncher</module>
+ </modules>
+ </profile>
+
+ </profiles>
+
+</project>