diff options
Diffstat (limited to 'sandbox/travelsample/node')
-rw-r--r-- | sandbox/travelsample/node/build.xml | 206 | ||||
-rw-r--r-- | sandbox/travelsample/node/pom.xml | 171 | ||||
-rw-r--r-- | sandbox/travelsample/node/src/scatours/LaunchNode.java | 109 |
3 files changed, 486 insertions, 0 deletions
diff --git a/sandbox/travelsample/node/build.xml b/sandbox/travelsample/node/build.xml new file mode 100644 index 0000000000..9280cccb97 --- /dev/null +++ b/sandbox/travelsample/node/build.xml @@ -0,0 +1,206 @@ +<!-- + * 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 name="scatours-node" default="compile"> + + <target name="compile"> + <mkdir dir="target/classes"/> + <javac destdir="target/classes" debug="on" source="1.5" target="1.5"> + <src path="src"/> + <classpath> + <fileset refid="tuscany.jars"/> + <fileset refid="3rdparty.jars"/> + </classpath> + </javac> + <copy todir="target/classes"> + <fileset dir="." excludes="**/*.java, pom.xml, build.xml, target"/> + </copy> + <jar destfile="target/scatours-node.jar" basedir="target/classes"> + <manifest> + <attribute name="Main-Class" value="launch.LaunchTutorialAdmin"/> + </manifest> + </jar> + </target> + + <target name="package" depends="compile"/> + + <target name="run"> + <java classname="launch.LaunchTutorialAdmin" fork="true"> + <classpath> + <pathelement location="target/scatours-node.jar"/> + <fileset refid="tuscany.jars"/> + <fileset refid="3rdparty.jars"/> + </classpath> + </java> + </target> + + <target name="clean"> + <delete includeemptydirs="true"> + <fileset dir="target"/> + </delete> + </target> + + <fileset id="tuscany.jars" dir="../../modules"> + <include name="tuscany-assembly-1.4-SNAPSHOT.jar"/> + <include name="tuscany-assembly-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-assembly-xsd-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-atom-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-atom-abdera-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-ejb-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-ejb-runtime-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-http-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-http-runtime-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-jsonrpc-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-jsonrpc-runtime-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-sca-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-sca-axis2-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-sca-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-ws-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-ws-axis2-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-ws-wsdlgen-1.4-SNAPSHOT.jar"/> + <include name="tuscany-binding-ws-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-contribution-1.4-SNAPSHOT.jar"/> + <include name="tuscany-contribution-impl-1.4-SNAPSHOT.jar"/> + <include name="tuscany-contribution-java-1.4-SNAPSHOT.jar"/> + <include name="tuscany-contribution-namespace-1.4-SNAPSHOT.jar"/> + <include name="tuscany-contribution-resource-1.4-SNAPSHOT.jar"/> + <include name="tuscany-contribution-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-core-1.4-SNAPSHOT.jar"/> + <include name="tuscany-core-databinding-1.4-SNAPSHOT.jar"/> + <include name="tuscany-core-spi-1.4-SNAPSHOT.jar"/> + <include name="tuscany-data-api-1.4-SNAPSHOT.jar"/> + <include name="tuscany-databinding-1.4-SNAPSHOT.jar"/> + <include name="tuscany-databinding-axiom-1.4-SNAPSHOT.jar"/> + <include name="tuscany-databinding-jaxb-1.4-SNAPSHOT.jar"/> + <include name="tuscany-databinding-jaxb-axiom-1.4-SNAPSHOT.jar"/> + <include name="tuscany-databinding-json-1.4-SNAPSHOT.jar"/> + <include name="tuscany-definitions-1.4-SNAPSHOT.jar"/> + <include name="tuscany-definitions-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-domain-manager-1.4-SNAPSHOT.jar"/> + <include name="tuscany-endpoint-1.4-SNAPSHOT.jar"/> + <include name="tuscany-extensibility-1.4-SNAPSHOT.jar"/> + <include name="tuscany-host-embedded-1.4-SNAPSHOT.jar"/> + <include name="tuscany-host-http-1.4-SNAPSHOT.jar"/> + <include name="tuscany-host-jetty-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-ejb-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-java-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-java-runtime-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-java-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-node-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-node-runtime-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-resource-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-resource-runtime-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-widget-1.4-SNAPSHOT.jar"/> + <include name="tuscany-implementation-widget-runtime-1.4-SNAPSHOT.jar"/> + <include name="tuscany-interface-1.4-SNAPSHOT.jar"/> + <include name="tuscany-interface-java-1.4-SNAPSHOT.jar"/> + <include name="tuscany-interface-java-jaxws-1.4-SNAPSHOT.jar"/> + <include name="tuscany-interface-java-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-interface-wsdl-1.4-SNAPSHOT.jar"/> + <include name="tuscany-interface-wsdl-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-monitor-1.4-SNAPSHOT.jar"/> + <include name="tuscany-monitor-logging-1.4-SNAPSHOT.jar"/> + <include name="tuscany-node-manager-1.4-SNAPSHOT.jar"/> + <include name="tuscany-node2-api-1.4-SNAPSHOT.jar"/> + <include name="tuscany-node2-impl-1.4-SNAPSHOT.jar"/> + <include name="tuscany-node2-launcher-1.4-SNAPSHOT.jar"/> + <include name="tuscany-policy-1.4-SNAPSHOT.jar"/> + <include name="tuscany-policy-security-1.4-SNAPSHOT.jar"/> + <include name="tuscany-policy-security-ws-1.4-SNAPSHOT.jar"/> + <include name="tuscany-policy-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-policy-xml-ws-1.4-SNAPSHOT.jar"/> + <include name="tuscany-sca-api-1.4-SNAPSHOT.jar"/> + <include name="tuscany-workspace-1.4-SNAPSHOT.jar"/> + <include name="tuscany-workspace-impl-1.4-SNAPSHOT.jar"/> + <include name="tuscany-workspace-xml-1.4-SNAPSHOT.jar"/> + <include name="tuscany-xsd-1.4-SNAPSHOT.jar"/> + <include name="tuscany-xsd-xml-1.4-SNAPSHOT.jar"/> + </fileset> + <fileset id="3rdparty.jars" dir="../../lib"> + <include name="XmlSchema-1.3.2.jar"/> + <include name="abdera-core-0.3.0-incubating.jar"/> + <include name="abdera-i18n-0.3.0-incubating.jar"/> + <include name="abdera-parser-0.3.0-incubating.jar"/> + <include name="activation-1.1.jar"/> + <include name="annogen-0.1.0.jar"/> + <include name="asm-all-3.1.jar"/> + <include name="axiom-api-1.2.5.jar"/> + <include name="axiom-dom-1.2.5.jar"/> + <include name="axiom-impl-1.2.5.jar"/> + <include name="axis2-adb-1.3.jar"/> + <include name="axis2-adb-codegen-1.3.jar"/> + <include name="axis2-codegen-1.3.jar"/> + <include name="axis2-java2wsdl-1.3.jar"/> + <include name="axis2-kernel-1.3.jar"/> + <include name="axis2-mtompolicy-1.3.jar"/> + <include name="backport-util-concurrent-3.0.jar"/> + <include name="bcprov-jdk15-132.jar"/> + <include name="cglib-nodep-2.1_3.jar"/> + <include name="commons-codec-1.3.jar"/> + <include name="commons-collections-3.1.jar"/> + <include name="commons-discovery-0.2.jar"/> + <include name="commons-fileupload-1.1.1.jar"/> + <include name="commons-httpclient-3.0.1.jar"/> + <include name="commons-io-1.1.jar"/> + <include name="commons-logging-1.1.jar"/> + <include name="derby-10.3.1.4.jar"/> + <include name="dom4j-1.6.1.jar"/> + <include name="geronimo-activation_1.0.2_spec-1.1.jar"/> + <include name="geronimo-activation_1.1_spec-1.0-M1.jar"/> + <include name="geronimo-commonj_1.1_spec-1.0.jar"/> + <include name="geronimo-ejb_3.0_spec-1.0.jar"/> + <include name="geronimo-javamail_1.4_spec-1.0-M1.jar"/> + <include name="geronimo-jms_1.1_spec-1.1.jar"/> + <include name="httpcore-4.0-alpha5.jar"/> + <include name="httpcore-nio-4.0-alpha5.jar"/> + <include name="httpcore-niossl-4.0-alpha5.jar"/> + <include name="jaxb-api-2.1.jar"/> + <include name="jaxb-impl-2.1.7.jar"/> + <include name="jaxen-1.1.1.jar"/> + <include name="jaxws-api-2.1.jar"/> + <include name="jdom-1.0.jar"/> + <include name="jettison-1.0.jar"/> + <include name="jetty-6.1.7.jar"/> + <include name="jetty-util-6.1.7.jar"/> + <include name="json-rpc-1.0.jar"/> + <include name="jsr181-api-1.0-MR1.jar"/> + <include name="jsr250-api-1.0.jar"/> + <include name="junit-3.8.1.jar"/> + <include name="log4j-1.2.12.jar"/> + <include name="logkit-1.0.1.jar"/> + <include name="mail-1.4.jar"/> + <include name="neethi-2.0.2.jar"/> + <include name="opensaml-1.1.jar"/> + <include name="rampart-core-1.3.jar"/> + <include name="rampart-policy-1.3.jar"/> + <include name="rampart-trust-1.3.jar"/> + <include name="servlet-api-2.5.jar"/> + <include name="stax-api-1.0-2.jar"/> + <include name="stax-api-1.0.1.jar"/> + <include name="woden-1.0-incubating-M7b.jar"/> + <include name="wsdl4j-1.6.2.jar"/> + <include name="wss4j-1.5.3.jar"/> + <include name="wstx-asl-3.2.1.jar"/> + <include name="xalan-2.7.0.jar"/> + <include name="xercesImpl-2.8.1.jar"/> + <include name="xml-apis-1.3.03.jar"/> + <include name="xmlsec-1.4.0.jar"/> + </fileset> + +</project> diff --git a/sandbox/travelsample/node/pom.xml b/sandbox/travelsample/node/pom.xml new file mode 100644 index 0000000000..8674b0c060 --- /dev/null +++ b/sandbox/travelsample/node/pom.xml @@ -0,0 +1,171 @@ +<?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.4-SNAPSHOT</version> + <!--relativePath>../../pom.xml</relativePath--> + </parent> + <artifactId>scatours-node</artifactId> + <name>Apache Tuscany SCA Tours Node</name> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node2-api</artifactId> + <version>1.4-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node2-launcher</artifactId> + <version>1.4-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-domain-manager</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-node-runtime</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-widget-runtime</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-resource-runtime</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-atom-abdera</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-http-runtime</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-sca-axis2</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ejb-runtime</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-ejb</artifactId> + <version>1.4-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>10.3.1.4</version> + <scope>runtime</scope> + </dependency> + + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <sourceDirectory>${basedir}/src</sourceDirectory> + <resources> + <resource> + <directory>${basedir}</directory> + <excludes> + <exclude>**/*.java</exclude> + <exclude>**/.*/**</exclude> + <exclude>pom.xml</exclude> + <exclude>build.xml</exclude> + <exclude>target/**</exclude> + <exclude>src/**</exclude> + </excludes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-maven-ant-generator</artifactId> + <version>1.4-SNAPSHOT</version> + <executions> + <execution> + <configuration> + <mainClass>launch.LaunchTutorialAdmin</mainClass> + </configuration> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/sandbox/travelsample/node/src/scatours/LaunchNode.java b/sandbox/travelsample/node/src/scatours/LaunchNode.java new file mode 100644 index 0000000000..61f4fa27f8 --- /dev/null +++ b/sandbox/travelsample/node/src/scatours/LaunchNode.java @@ -0,0 +1,109 @@ +/* + * 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.SCANode2; +import org.apache.tuscany.sca.node.SCANode2Factory; +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 launchFromFileSystemJar(){ + SCANode2 node = null; + + try { + node = SCANode2Factory.newInstance().createSCANode("scatours.composite", + new SCAContribution("common", "../common-contribution/target/scatours-common-contribution.jar"), + new SCAContribution("currency", "../currency-contribution/target/scatours-currency-contribution.jar"), + new SCAContribution("hotel", "../hotel-contribution/target/scatours-hotel-contribution.jar"), + new SCAContribution("trip", "../trip-contribution/target/scatours-trip-contribution.jar"), + new SCAContribution("ui", "../ui-contribution/target/scatours-ui-contribution.jar")); + + 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()); + } + } + + // OK for development but you must launch the node from this module + public static void launchFromFileSystemDir(){ + SCANode2 node = null; + + try { + node = SCANode2Factory.newInstance().createSCANode("scatours.composite", + new SCAContribution("common", "../common-contribution/target/classes"), + new SCAContribution("currency", "../currency-contribution/target/classes"), + new SCAContribution("hotel", "../hotel-contribution/target/classes"), + new SCAContribution("trip", "../trip-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()); + } + } + + // OK for samples but you can only load one contribution + public static void launchFromClasspath(){ + SCANode2 node = null; + + try { + node = SCANode2Factory.newInstance().createSCANodeFromClassLoader("scatours.composite", null); + 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()); + } + } + + // have to be running the domain in this case + public static void launchFromDomain()throws Exception { + NodeLauncher.main(new String[] {"http://localhost:9990/node-config/SCAToursNode"}); + } +} |