diff options
Diffstat (limited to 'sandbox/travelsample')
21 files changed, 482 insertions, 275 deletions
diff --git a/sandbox/travelsample/chapter-02/build.xml b/sandbox/travelsample/chapter-02/build.xml new file mode 100644 index 0000000000..a58fed933a --- /dev/null +++ b/sandbox/travelsample/chapter-02/build.xml @@ -0,0 +1,45 @@ +<!--
+ * 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-chapter-02" default="compile">
+
+ <target name="compile">
+ <antcall target="allsubdirs">
+ <param name="target" value="compile"/>
+ </antcall>
+ </target>
+
+ <target name="run">
+ <ant dir="node" target="run"/>
+ </target>
+
+ <target name="clean">
+ <antcall target="allsubdirs">
+ <param name="target" value="clean"/>
+ </antcall>
+ </target>
+
+ <target name="allsubdirs">
+ <ant dir="goodvaluetrips-contribution" target="${target}"/>
+ <ant dir="tuscanyscatours-contribution" target="${target}"/>
+ <ant dir="client-contribution" target="${target}"/>
+ <ant dir="node" target="${target}"/>
+ </target>
+
+</project>
diff --git a/sandbox/travelsample/chapter-02/client-contribution/build.xml b/sandbox/travelsample/chapter-02/client-contribution/build.xml new file mode 100644 index 0000000000..17bc0d7d5b --- /dev/null +++ b/sandbox/travelsample/chapter-02/client-contribution/build.xml @@ -0,0 +1,45 @@ +<!--
+ * 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-chapter-02-client-contribution" default="compile">
+ <property environment="env"/>
+
+ <target name="compile">
+ <mkdir dir="target/classes"/>
+ <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+ <src path="src/main/java"/>
+ <classpath>
+ <pathelement location="../tuscanyscatours-contribution/target/scatours-chapter-02-tuscanyscatours-contribution.jar"/>
+ <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/scatours-chapter-02-client-contribution.jar"
+ basedir="target/classes"/>
+ </target>
+
+ <target name="clean">
+ <delete includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+
+</project>
diff --git a/sandbox/travelsample/chapter-02/client-contribution/pom.xml b/sandbox/travelsample/chapter-02/client-contribution/pom.xml new file mode 100644 index 0000000000..81d6fe80ef --- /dev/null +++ b/sandbox/travelsample/chapter-02/client-contribution/pom.xml @@ -0,0 +1,48 @@ +<?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.5-SNAPSHOT</version>
+ <!--relativePath>../../pom.xml</relativePath-->
+ </parent>
+ <artifactId>scatours-chapter-02-client-contribution</artifactId>
+ <name>Apache Tuscany SCA Tours Chapter 02 Test Client Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-chapter-02-tuscanyscatours-contribution</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/sandbox/travelsample/chapter-02/client-contribution/src/main/java/scatours/client/TestClient.java b/sandbox/travelsample/chapter-02/client-contribution/src/main/java/scatours/client/TestClient.java new file mode 100644 index 0000000000..cb80368918 --- /dev/null +++ b/sandbox/travelsample/chapter-02/client-contribution/src/main/java/scatours/client/TestClient.java @@ -0,0 +1,46 @@ +/*
+ * 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.client;
+
+import com.tuscanyscatours.Bookings;
+import com.tuscanyscatours.Checkout;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(Runnable.class)
+public class TestClient {
+ @Reference
+ protected Bookings bookings;
+
+ @Reference
+ protected Checkout checkout;
+
+ public TestClient() {
+ }
+
+ public void run() {
+ String bookingCode = bookings.newBooking("FS1APR4", 1);
+ System.out.println("Booking code is " + bookingCode);
+
+ checkout.makePayment(1995.00, "1234567843218765 10/10");
+ System.out.println("Paid $1995.00");
+ }
+}
diff --git a/sandbox/travelsample/chapter-02/client-contribution/src/main/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/chapter-02/client-contribution/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..54ae0dbd0a --- /dev/null +++ b/sandbox/travelsample/chapter-02/client-contribution/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,25 @@ +<?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.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:client="http://client.scatours/">
+ <export namespace="http://client.scatours/" />
+ <import.java package="com.tuscanyscatours" />
+ <deployable composite="client:Client" />
+</contribution>
diff --git a/sandbox/travelsample/chapter-02/client-contribution/src/main/resources/client.composite b/sandbox/travelsample/chapter-02/client-contribution/src/main/resources/client.composite new file mode 100644 index 0000000000..05c2755114 --- /dev/null +++ b/sandbox/travelsample/chapter-02/client-contribution/src/main/resources/client.composite @@ -0,0 +1,29 @@ +<?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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://client.scatours/"
+ name="Client">
+
+ <component name="TestClient">
+ <implementation.java class="scatours.client.TestClient" />
+ <reference name="bookings" target="TripBooking/Bookings" />
+ <reference name="checkout" target="ShoppingCart/Checkout" />
+ </component>
+</composite>
diff --git a/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/build.xml b/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/build.xml new file mode 100644 index 0000000000..fa67a921e2 --- /dev/null +++ b/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/build.xml @@ -0,0 +1,44 @@ +<!--
+ * 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-chapter-02-goodvaluetrips-contribution" default="compile">
+ <property environment="env"/>
+
+ <target name="compile">
+ <mkdir dir="target/classes"/>
+ <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+ <src path="src/main/java"/>
+ <classpath>
+ <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/scatours-chapter-02-goodvaluetrips-contribution.jar"
+ basedir="target/classes"/>
+ </target>
+
+ <target name="clean">
+ <delete includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+
+</project>
diff --git a/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/pom.xml b/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/pom.xml index fe64ac94b3..6bbcf056af 100644 --- a/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/pom.xml +++ b/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/pom.xml @@ -34,21 +34,6 @@ <artifactId>tuscany-sca-api</artifactId> <version>1.5-SNAPSHOT</version> </dependency> - - <!-- - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>scatours-common-contribution</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - --> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> </dependencies> <build> diff --git a/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/src/main/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/src/main/resources/META-INF/sca-contribution.xml index 38b94949ab..6ed07d5612 100644 --- a/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/src/main/resources/META-INF/sca-contribution.xml +++ b/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/src/main/resources/META-INF/sca-contribution.xml @@ -18,6 +18,7 @@ * under the License. --> <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:gvtrips="http://goodvaluetrips.com/"> - <deployable composite="gvtrips:trips"/> + xmlns:gvt="http://goodvaluetrips.com/"> + <export namespace="http://goodvaluetrips.com/" /> + <deployable composite="gvt:Trips" /> </contribution> diff --git a/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/src/main/resources/trips.composite b/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/src/main/resources/trips.composite index cdd009b1b2..ab173e5ef7 100644 --- a/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/src/main/resources/trips.composite +++ b/sandbox/travelsample/chapter-02/goodvaluetrips-contribution/src/main/resources/trips.composite @@ -19,7 +19,7 @@ -->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://goodvaluetrips.com/"
- name="trips">
+ name="Trips">
<component name="TripProvider">
<implementation.java class="com.goodvaluetrips.TripProvider" />
diff --git a/sandbox/travelsample/chapter-02/node/build.xml b/sandbox/travelsample/chapter-02/node/build.xml index 1d3e3adea3..0c3c506b67 100644 --- a/sandbox/travelsample/chapter-02/node/build.xml +++ b/sandbox/travelsample/chapter-02/node/build.xml @@ -18,34 +18,31 @@ --> <project name="scatours-chapter-02-node" default="compile"> + <property environment="env"/> <target name="compile"> <mkdir dir="target/classes"/> <javac destdir="target/classes" debug="on" source="1.5" target="1.5"> - <src path="src"/> + <src path="src/main/java"/> <classpath> - <fileset refid="tuscany.jars"/> - <fileset refid="3rdparty.jars"/> + <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/> </classpath> </javac> <copy todir="target/classes"> - <fileset dir="." excludes="**/*.java, pom.xml, build.xml, target"/> + <fileset dir="src/main/resources"/> </copy> <jar destfile="target/scatours-chapter-02-node.jar" basedir="target/classes"> <manifest> - <attribute name="Main-Class" value="launch.LaunchTutorialAdmin"/> + <attribute name="Main-Class" value="scatours.LaunchNode"/> </manifest> </jar> </target> - <target name="package" depends="compile"/> - <target name="run"> - <java classname="launch.LaunchTutorialAdmin" fork="true"> + <java classname="scatours.LaunchNode" fork="true"> <classpath> - <pathelement location="target/scatours-chapter-02-node.jar"/> - <fileset refid="tuscany.jars"/> - <fileset refid="3rdparty.jars"/> + <pathelement location="target/classes"/> + <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/> </classpath> </java> </target> @@ -56,129 +53,4 @@ </delete> </target> - <fileset id="tuscany.jars" dir="../../modules"> - <include name="tuscany-assembly-1.5-SNAPSHOT.jar"/> - <include name="tuscany-assembly-xml-1.5-SNAPSHOT.jar"/> - <include name="tuscany-assembly-xsd-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-http-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-http-runtime-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-jsonrpc-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-jsonrpc-runtime-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-sca-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-sca-axis2-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-sca-xml-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-ws-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-ws-axis2-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-ws-axis2-policy-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-ws-wsdlgen-1.5-SNAPSHOT.jar"/> - <include name="tuscany-binding-ws-xml-1.5-SNAPSHOT.jar"/> - <include name="tuscany-contribution-1.5-SNAPSHOT.jar"/> - <include name="tuscany-contribution-impl-1.5-SNAPSHOT.jar"/> - <include name="tuscany-contribution-java-1.5-SNAPSHOT.jar"/> - <include name="tuscany-contribution-namespace-1.5-SNAPSHOT.jar"/> - <include name="tuscany-contribution-xml-1.5-SNAPSHOT.jar"/> - <include name="tuscany-core-1.5-SNAPSHOT.jar"/> - <include name="tuscany-core-databinding-1.5-SNAPSHOT.jar"/> - <include name="tuscany-core-spi-1.5-SNAPSHOT.jar"/> - <include name="tuscany-data-api-1.5-SNAPSHOT.jar"/> - <include name="tuscany-databinding-1.5-SNAPSHOT.jar"/> - <include name="tuscany-databinding-axiom-1.5-SNAPSHOT.jar"/> - <include name="tuscany-databinding-jaxb-1.5-SNAPSHOT.jar"/> - <include name="tuscany-databinding-jaxb-axiom-1.5-SNAPSHOT.jar"/> - <include name="tuscany-databinding-json-1.5-SNAPSHOT.jar"/> - <include name="tuscany-definitions-1.5-SNAPSHOT.jar"/> - <include name="tuscany-definitions-xml-1.5-SNAPSHOT.jar"/> - <include name="tuscany-endpoint-1.5-SNAPSHOT.jar"/> - <include name="tuscany-extensibility-1.5-SNAPSHOT.jar"/> - <include name="tuscany-host-http-1.5-SNAPSHOT.jar"/> - <include name="tuscany-implementation-java-1.5-SNAPSHOT.jar"/> - <include name="tuscany-implementation-java-runtime-1.5-SNAPSHOT.jar"/> - <include name="tuscany-implementation-java-xml-1.5-SNAPSHOT.jar"/> - <include name="tuscany-implementation-node-1.5-SNAPSHOT.jar"/> - <include name="tuscany-implementation-node-runtime-1.5-SNAPSHOT.jar"/> - <include name="tuscany-implementation-resource-1.5-SNAPSHOT.jar"/> - <include name="tuscany-implementation-resource-runtime-1.5-SNAPSHOT.jar"/> - <include name="tuscany-interface-1.5-SNAPSHOT.jar"/> - <include name="tuscany-interface-java-1.5-SNAPSHOT.jar"/> - <include name="tuscany-interface-java-jaxws-1.5-SNAPSHOT.jar"/> - <include name="tuscany-interface-java-xml-1.5-SNAPSHOT.jar"/> - <include name="tuscany-interface-wsdl-1.5-SNAPSHOT.jar"/> - <include name="tuscany-interface-wsdl-xml-1.5-SNAPSHOT.jar"/> - <include name="tuscany-monitor-1.5-SNAPSHOT.jar"/> - <include name="tuscany-node-api-1.5-SNAPSHOT.jar"/> - <include name="tuscany-node-impl-1.5-SNAPSHOT.jar"/> - <include name="tuscany-node-launcher-1.5-SNAPSHOT.jar"/> - <include name="tuscany-policy-1.5-SNAPSHOT.jar"/> - <include name="tuscany-policy-security-1.5-SNAPSHOT.jar"/> - <include name="tuscany-policy-xml-1.5-SNAPSHOT.jar"/> - <include name="tuscany-policy-xml-ws-1.5-SNAPSHOT.jar"/> - <include name="tuscany-sca-api-1.5-SNAPSHOT.jar"/> - <include name="tuscany-sca-api-extension-1.5-SNAPSHOT.jar"/> - <include name="tuscany-xsd-1.5-SNAPSHOT.jar"/> - <include name="tuscany-xsd-xml-1.5-SNAPSHOT.jar"/> - </fileset> - <fileset id="3rdparty.jars" dir="../../lib"> - <include name="XmlSchema-1.5-SNAPSHOT.2.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.7.jar"/> - <include name="axiom-dom-1.2.7.jar"/> - <include name="axiom-impl-1.2.7.jar"/> - <include name="axis-ant-1.5-SNAPSHOT.jar"/> - <include name="axis2-adb-1.5-SNAPSHOT.1.jar"/> - <include name="axis2-codegen-1.5-SNAPSHOT.1.jar"/> - <include name="axis2-java2wsdl-1.5-SNAPSHOT.1.jar"/> - <include name="axis2-kernel-1.5-SNAPSHOT.1.jar"/> - <include name="axis2-mtompolicy-1.5-SNAPSHOT.1.jar"/> - <include name="backport-util-concurrent-3.1.jar"/> - <include name="bcprov-jdk13-132.jar"/> - <include name="cglib-nodep-2.2.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.2.jar"/> - <include name="commons-httpclient-3.1.jar"/> - <include name="commons-io-1.5-SNAPSHOT.jar"/> - <include name="commons-logging-1.1.1.jar"/> - <include name="derby-10.3.1.5-SNAPSHOT.jar"/> - <include name="dom4j-1.6.1.jar"/> - <include name="geronimo-activation_1.1_spec-1.0.1.jar"/> - <include name="geronimo-javamail_1.5-SNAPSHOT_spec-1.2.jar"/> - <include name="geronimo-jms_1.1_spec-1.1.jar"/> - <include name="geronimo-stax-api_1.0_spec-1.0.1.jar"/> - <include name="httpcore-4.0-beta1.jar"/> - <include name="httpcore-nio-4.0-beta1.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.1.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-4.5.jar"/> - <include name="log4j-1.2.15.jar"/> - <include name="mail-1.5-SNAPSHOT.jar"/> - <include name="mex-1.5-SNAPSHOT1-impl.jar"/> - <include name="neethi-2.0.4.jar"/> - <include name="opensaml-1.1.jar"/> - <include name="rampart-core-1.5-SNAPSHOT.jar"/> - <include name="rampart-policy-1.5-SNAPSHOT.jar"/> - <include name="rampart-trust-1.5-SNAPSHOT.jar"/> - <include name="servlet-api-2.3.jar"/> - <include name="stax-api-1.0-2.jar"/> - <include name="woden-api-1.0M8.jar"/> - <include name="woden-impl-dom-1.0M8.jar"/> - <include name="wsdl4j-1.6.2.jar"/> - <include name="wss4j-1.5.4.jar"/> - <include name="wstx-asl-3.2.4.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="xmlParserAPIs-2.6.0.jar"/> - <include name="xmlsec-1.5-SNAPSHOT.2.jar"/> - </fileset> - </project> diff --git a/sandbox/travelsample/chapter-02/node/pom.xml b/sandbox/travelsample/chapter-02/node/pom.xml index 15fbfaf79c..737649372a 100644 --- a/sandbox/travelsample/chapter-02/node/pom.xml +++ b/sandbox/travelsample/chapter-02/node/pom.xml @@ -29,23 +29,10 @@ <name>Apache Tuscany SCA Tours Chapter 02 Node</name> <dependencies> - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-api</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-node-launcher</artifactId> - <version>1.5-SNAPSHOT</version> - </dependency> - <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-node-runtime</artifactId> + <artifactId>tuscany-node-api</artifactId> <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> </dependency> <dependency> @@ -57,81 +44,20 @@ <dependency> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-implementation-resource-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-http-runtime</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-ws-axis2</artifactId> - <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-sca-axis2</artifactId> + <artifactId>tuscany-implementation-node-runtime</artifactId> <version>1.5-SNAPSHOT</version> - <scope>runtime</scope> + <scope>test</scope> </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>derby</artifactId> - <version>10.3.1.5-SNAPSHOT</version> - <scope>runtime</scope> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.5</version> + <scope>test</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.5-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/chapter-02/node/src/main/java/scatours/LaunchNode.java b/sandbox/travelsample/chapter-02/node/src/main/java/scatours/LaunchNode.java index 777963c13e..b7888c8749 100644 --- a/sandbox/travelsample/chapter-02/node/src/main/java/scatours/LaunchNode.java +++ b/sandbox/travelsample/chapter-02/node/src/main/java/scatours/LaunchNode.java @@ -19,48 +19,34 @@ package scatours; -import java.io.IOException; - +import org.apache.tuscany.sca.node.SCAClient; 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")); + SCANode node = SCANodeFactory.newInstance().createSCANode("scatours.composite", + new SCAContribution("goodvaluetrips", "../goodvaluetrips-contribution/target/classes"), + new SCAContribution("tuscanyscatours", "../tuscanyscatours-contribution/target/classes"), + new SCAContribution("client", "../client-contribution/target/classes"), + new SCAContribution("node", "./target/classes")); node.start(); - - System.out.println("Node started - Press enter to shutdown."); - try { - System.in.read(); - } catch (IOException e) {} - + + Runnable runner = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable"); + runner.run(); + node.stop(); - } catch (Exception ex) { - System.out.println(ex.toString()); + } catch (Throwable th) { + th.printStackTrace(); } - } + } } diff --git a/sandbox/travelsample/chapter-02/node/src/main/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/chapter-02/node/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..4a6250ad25 --- /dev/null +++ b/sandbox/travelsample/chapter-02/node/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,26 @@ +<?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.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:scatours="http://scatours">
+ <import namespace="http://tuscanyscatours.com/" />
+ <import namespace="http://goodvaluetrips.com/" />
+ <import namespace="http://client.scatours/" />
+ <deployable composite="scatours:scatours" />
+</contribution>
diff --git a/sandbox/travelsample/chapter-02/node/src/main/resources/scatours.composite b/sandbox/travelsample/chapter-02/node/src/main/resources/scatours.composite new file mode 100644 index 0000000000..a5e26fd7b7 --- /dev/null +++ b/sandbox/travelsample/chapter-02/node/src/main/resources/scatours.composite @@ -0,0 +1,31 @@ +<?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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scatours"
+ xmlns:client="http://client.scatours/"
+ xmlns:tours="http://tuscanyscatours.com/"
+ xmlns:trips="http://goodvaluetrips.com/"
+ name="scatours">
+
+ <include name="client:Client" />
+ <include name="tours:Tours" />
+ <include name="trips:Trips" />
+
+</composite>
diff --git a/sandbox/travelsample/chapter-02/node/src/test/java/scatours/NodeTestCase.java b/sandbox/travelsample/chapter-02/node/src/test/java/scatours/NodeTestCase.java new file mode 100644 index 0000000000..d37e52a409 --- /dev/null +++ b/sandbox/travelsample/chapter-02/node/src/test/java/scatours/NodeTestCase.java @@ -0,0 +1,60 @@ +/*
+ * 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 org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests all the components and services in chapter 2
+ */
+public class NodeTestCase {
+
+ private SCANode node;
+
+ @Before
+ public void startServer() throws Exception {
+ try {
+ node = SCANodeFactory.newInstance().createSCANode("scatours.composite",
+ new SCAContribution("goodvaluetrips", "../goodvaluetrips-contribution/target/classes"),
+ new SCAContribution("tuscanyscatours", "../tuscanyscatours-contribution/target/classes"),
+ new SCAContribution("client", "../client-contribution/target/classes"),
+ new SCAContribution("node", "./target/classes"));
+ node.start();
+ } catch (Exception ex) {
+ System.out.println(ex.toString());
+ }
+ }
+
+ @Test
+ public void testClient() throws Exception {
+ Runnable runner = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable");
+ runner.run();
+ }
+
+ @After
+ public void stopServer() throws Exception {
+ node.stop();
+ }
+}
diff --git a/sandbox/travelsample/chapter-02/pom.xml b/sandbox/travelsample/chapter-02/pom.xml index 61d99c1777..0132a445e5 100644 --- a/sandbox/travelsample/chapter-02/pom.xml +++ b/sandbox/travelsample/chapter-02/pom.xml @@ -38,9 +38,8 @@ <modules> <module>goodvaluetrips-contribution</module> <module>tuscanyscatours-contribution</module> - <!-- + <module>client-contribution</module> <module>node</module> - --> </modules> </profile> diff --git a/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/build.xml b/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/build.xml new file mode 100644 index 0000000000..d9961176f3 --- /dev/null +++ b/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/build.xml @@ -0,0 +1,44 @@ +<!--
+ * 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-chapter-02-tuscanyscatours-contribution" default="compile">
+ <property environment="env"/>
+
+ <target name="compile">
+ <mkdir dir="target/classes"/>
+ <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+ <src path="src/main/java"/>
+ <classpath>
+ <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/scatours-chapter-02-tuscanyscatours-contribution.jar"
+ basedir="target/classes"/>
+ </target>
+
+ <target name="clean">
+ <delete includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+
+</project>
diff --git a/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/pom.xml b/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/pom.xml index dc6cea44ae..6913d7665d 100644 --- a/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/pom.xml +++ b/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/pom.xml @@ -34,13 +34,6 @@ <artifactId>tuscany-sca-api</artifactId> <version>1.5-SNAPSHOT</version> </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.5</version> - <scope>test</scope> - </dependency> </dependencies> <build> diff --git a/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/src/main/resources/META-INF/sca-contribution.xml b/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/src/main/resources/META-INF/sca-contribution.xml index e3614abda3..cf1153ac14 100644 --- a/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/src/main/resources/META-INF/sca-contribution.xml +++ b/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/src/main/resources/META-INF/sca-contribution.xml @@ -18,6 +18,8 @@ * under the License. --> <contribution xmlns="http://www.osoa.org/xmlns/sca/1.0" - xmlns:scatours="http://tuscanyscatours.com/"> - <deployable composite="scatours:tours"/> + xmlns:tst="http://tuscanyscatours.com/"> + <export namespace="http://tuscanyscatours.com/" /> + <export.java package="com.tuscanyscatours" /> + <deployable composite="tst:Tours" /> </contribution> diff --git a/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/src/main/resources/tours.composite b/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/src/main/resources/tours.composite index 62fa1fd792..f166a1635d 100644 --- a/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/src/main/resources/tours.composite +++ b/sandbox/travelsample/chapter-02/tuscanyscatours-contribution/src/main/resources/tours.composite @@ -19,7 +19,7 @@ -->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://tuscanyscatours.com/"
- name="tours">
+ name="Tours">
<component name="TripBooking">
<implementation.java class="com.tuscanyscatours.TripBooking" />
|