diff options
Diffstat (limited to '')
-rw-r--r-- | sandbox/travelsample/chapter-05/node/build.xml (renamed from sandbox/travelsample/node/build.xml) | 6 | ||||
-rw-r--r-- | sandbox/travelsample/chapter-05/node/pom.xml (renamed from sandbox/travelsample/node/pom.xml) | 4 | ||||
-rw-r--r-- | sandbox/travelsample/chapter-05/node/src/scatours/LaunchNode.java | 66 |
3 files changed, 71 insertions, 5 deletions
diff --git a/sandbox/travelsample/node/build.xml b/sandbox/travelsample/chapter-05/node/build.xml index ff93d7a224..a70be4e664 100644 --- a/sandbox/travelsample/node/build.xml +++ b/sandbox/travelsample/chapter-05/node/build.xml @@ -17,7 +17,7 @@ * under the License. --> -<project name="scatours-node" default="compile"> +<project name="scatours-chapter-05-node" default="compile"> <target name="compile"> <mkdir dir="target/classes"/> @@ -31,7 +31,7 @@ <copy todir="target/classes"> <fileset dir="." excludes="**/*.java, pom.xml, build.xml, target"/> </copy> - <jar destfile="target/scatours-node.jar" basedir="target/classes"> + <jar destfile="target/scatours-chapter-05-node.jar" basedir="target/classes"> <manifest> <attribute name="Main-Class" value="launch.LaunchTutorialAdmin"/> </manifest> @@ -43,7 +43,7 @@ <target name="run"> <java classname="launch.LaunchTutorialAdmin" fork="true"> <classpath> - <pathelement location="target/scatours-node.jar"/> + <pathelement location="target/scatours-chapter-05-node.jar"/> <fileset refid="tuscany.jars"/> <fileset refid="3rdparty.jars"/> </classpath> diff --git a/sandbox/travelsample/node/pom.xml b/sandbox/travelsample/chapter-05/node/pom.xml index 77f8073b0b..d42e8b2fa6 100644 --- a/sandbox/travelsample/node/pom.xml +++ b/sandbox/travelsample/chapter-05/node/pom.xml @@ -25,8 +25,8 @@ <version>1.5-SNAPSHOT</version> <!--relativePath>../../pom.xml</relativePath--> </parent> - <artifactId>scatours-node</artifactId> - <name>Apache Tuscany SCA Tours Node</name> + <artifactId>scatours-chapter-05-node</artifactId> + <name>Apache Tuscany SCA Tours Chapter 05 Node</name> <dependencies> <dependency> diff --git a/sandbox/travelsample/chapter-05/node/src/scatours/LaunchNode.java b/sandbox/travelsample/chapter-05/node/src/scatours/LaunchNode.java new file mode 100644 index 0000000000..777963c13e --- /dev/null +++ b/sandbox/travelsample/chapter-05/node/src/scatours/LaunchNode.java @@ -0,0 +1,66 @@ +/* + * 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 scatours; + +import java.io.IOException; + +import org.apache.tuscany.sca.node.SCAContribution; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; +import org.apache.tuscany.sca.node.launcher.NodeLauncher; + +public class LaunchNode { + public static void main(String[] args) throws Exception { + LaunchNode.launchFromFileSystemDir(); + } + + // OK for development but you must launch the node from this module + public static void launchFromFileSystemDir(){ + SCANode node = null; + + try { + node = SCANodeFactory.newInstance().createSCANode("scatours.composite", + new SCAContribution("common", "../../shared-contributions/common-contribution/target/classes"), + new SCAContribution("currency", "../../shared-contributions/currency-contribution/target/classes"), + new SCAContribution("hotel", "../../shared-contributions/hotel-contribution/target/classes"), + new SCAContribution("flight", "../../shared-contributions/flight-contribution/target/classes"), + new SCAContribution("car", "../../shared-contributions/car-contribution/target/classes"), + new SCAContribution("trip", "../../shared-contributions/trip-contribution/target/classes"), + new SCAContribution("tripbooking", "../../shared-contributions/tripbooking-contribution/target/classes"), + new SCAContribution("travelcatalog", "../../shared-contributions/travelcatalog-contribution/target/classes"), + new SCAContribution("payment", "../../shared-contributions/payment-contribution/target/classes"), + new SCAContribution("emailgateway", "../../shared-contributions/emailgateway-contribution/target/classes"), + new SCAContribution("shoppingcart", "../../shared-contributions/shoppingcart-contribution/target/classes"), + new SCAContribution("scatours", "../../shared-contributions/scatours-contribution/target/classes"), + new SCAContribution("ui", "../ui-contribution/target/classes")); + node.start(); + + System.out.println("Node started - Press enter to shutdown."); + try { + System.in.read(); + } catch (IOException e) {} + + node.stop(); + + } catch (Exception ex) { + System.out.println(ex.toString()); + } + } +} |