diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-02 09:24:41 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-02 09:24:41 +0000 |
commit | 1a782a0069143286e9e386c628cd4e58c3b51e46 (patch) | |
tree | 57393296922a6f2b2b2d5a8476955e6e355b8152 /sandbox/travelsample | |
parent | cb17099e7fb5f31435e57e1ee2c60f85b06e0868 (diff) |
Add/fix ant scripts for contents of travel sample services and launchers directories (TUSCANY-3398)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@895152 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/travelsample')
56 files changed, 624 insertions, 641 deletions
diff --git a/sandbox/travelsample/antdefs.xml b/sandbox/travelsample/antdefs.xml index 92bd5e0425..00d69133ea 100644 --- a/sandbox/travelsample/antdefs.xml +++ b/sandbox/travelsample/antdefs.xml @@ -29,47 +29,62 @@ TUSCANY_HOME A directory containing the Tuscany binary distribution.
JUNIT_JAR The location of the JUnit jar file. The JUnit version used
for testing these build files was JUnit 4.5.
+ TUSCANY_HOST_CORBA (only needed to run CORBA services) A directory
+ containing the Tuscany JSE CORBA host jars.
This file defines the following targets that can be used on the
ant command that invokes the build.xml file:
- <compile> Compiles any Java source files that don't have an up-to-date
+ "compile" Compiles any Java source files that don't have an up-to-date
class file, and copies any files in or under the resource directory.
If the build.xml file contains a <path> element with the id
"compile-path", the contents of this path are added to the compiler's
classpath. Also invokes the following targets:
- . <wsdljava> (defined in the build.xml file) if there are any
+ . "wsdljava" (defined in the build.xml file) if there are any
.wsdl files in or under the resource directory
- . <test> if there are any files in or under the src/test/java
+ . "idljava" (defined in the build.xml file) if there are any
+ .idl files in or under the resource directory
+ . "test" if there are any files in or under the src/test/java
directory
- . <package> if all previous steps completed successfully
- <test> Compiles any Java unit test files that don't have an
- up-to-date class file, copies any test resources in or under
- the src/test/resources directory, and runs the unit tests.
- If the build.xml file contains a <path> element with the id
- "test-path", the contents of this path are added to the unit test
- classpath. If the build.xml file defines the "test-setup" property,
- the <test-setup> target in the build.xml file is invoked after
- copying the test resources.
- <package> Creates a jar file containing the compiled Java class
+ . "package" if all previous steps completed successfully
+ "test" Compiles any Java unit test files that don't have an
+ up-to-date class file, copies any test resources in or under the
+ src/test/resources directory, and runs the unit tests. If the
+ build.xml file contains a <path> element with the id "test-path",
+ the contents of this path are used for compiling and running the
+ unit tests. In addition, the "compile-path" setting (if specified)
+ is used for running unit tests. If the build.xml file defines the
+ "test-setup" property, the "testsetup" target in the build.xml
+ file is invoked after copying the test resources.
+ "package" Creates a jar file containing the compiled Java class
files (excluding unit test code) and any files in or under the
resource directory, unless the jar file is already up to date.
- <clean> Deletes all the files produced by the build.
+ If the build.xml file defines a path with id "package-path", this
+ path is used for the Class-Path manifest entry.
+ "run" Runs the class specified by the "run-class" property in the
+ build.xml file if this property is defined. If the build.xml file
+ contains a <path> element with id "run-path", the contents of this
+ path are added to the run classpath.
+ "clean" Deletes all the files produced by the build.
This file also defines the following targets for invocation by <antcall>
- within the <wsdljava> target in the build.xml file:
- <wsimport> Generates Java code from a WSDL file (unless the Java
+ from the build.xml file:
+ "wsimport" Generates Java code from a WSDL file (unless the Java
code is already up to date) by running the JDK wsimport command.
Requires the following parameters:
. <package> the Java package to use for generated code
. <wsdlfile> the filename of the WSDL file
. <javaclass> the filename of any Java class file that will be
- generated by running wsimport on the WSDL file
- <sdojavagen> Generates Java code from a WSDL file (unless the Java
+ generated by running this target on the WSDL file
+ "sdojavagen" Generates Java code from a WSDL file (unless the Java
code is already up to date) by running the SDO XSD2JavaGenerator.
Requires the same parameters as <wsimport>, plus the following:
. <prefix> the prefix string for naming the generated factory
- The build.xml file can make any number of calls to <wsimport> and/or
- <sdojavagen>.
+ "idlj" Generates Java code from a CORBA IDL file (unless the Java
+ code is already up to date) by running the JDK idlj command.
+ Requires the following parameters:
+ . <idlfile> the filename of the IDL file
+ . <javaclass> the filename of any Java class file that will be
+ generated by running this target for this IDL file
All other targets defined by this file (with names starting with "#")
are for internal use from within this file and are not intended to
@@ -140,6 +155,43 @@ </javac>
</target>
+ <!-- check whether there are any CORBA IDL files in or under the resource directory -->
+ <target name="#find-idlfiles">
+ <fileset id="#allidl" dir="src/main/resources">
+ <include name="**/*.idl"/>
+ </fileset>
+ <condition property="#idlfiles">
+ <and>
+ <available file="src/main/resources" type="dir"/>
+ <resourcecount refid="#allidl" when="greater" count="0"/>
+ </and>
+ </condition>
+ </target>
+
+ <!-- call the idljava target in the build.xml file if required -->
+ <target name="#call-idljava" depends="#find-idlfiles" if="#idlfiles">
+ <antcall target="idljava"/>
+ </target>
+
+ <!-- check whether the IDL-generated Java code is already up to date -->
+ <target name="#idlcheck">
+ <condition property="#idl-uptodate">
+ <uptodate srcfile="src/main/resources/${idlfile}"
+ targetfile="target/classes/${javaclass}"/>
+ </condition>
+ </target>
+
+ <!-- run the JDK idlj command if required, then compile the generated Java source -->
+ <target name="idlj" depends="#idlcheck" unless="#idl-uptodate">
+ <mkdir dir="target/idlj-source"/>
+ <exec executable="${java.home}/../bin/idlj">
+ <arg line="-fall -td target/idlj-source src/main/resources/${idlfile}"/>
+ </exec>
+ <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+ <src path="target/idlj-source"/>
+ </javac>
+ </target>
+
<!-- check whether there are any Java source files to compile -->
<target name="#find-javafiles">
<fileset id="#alljava" dir="src/main/java">
@@ -239,7 +291,7 @@ <!-- perform additional test setup if required -->
<target name="#test-setup" if="test-setup">
- <antcall target="test-setup"/>
+ <antcall target="testsetup"/>
</target>
<!-- check whether a dependency path for the unit tests was specified -->
@@ -262,13 +314,14 @@ </target>
<!-- run the junit task -->
- <target name="#run-junit" depends="#set-test-classpath, #default-test-classpath">
+ <target name="#run-junit" depends="#set-test-classpath, #default-test-classpath, #set-classpath, #default-classpath">
<junit printsummary="no" haltonfailure="yes" dir="."
fork="yes" forkmode="once">
<classpath>
<pathelement location="target/test-classes"/>
- <pathelement location="target/classes"/>
<path refid="#test-classpath"/>
+ <pathelement location="target/classes"/>
+ <path refid="#javac-classpath"/>
<pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
<pathelement location="${env.JUNIT_JAR}"/>
</classpath>
@@ -309,14 +362,42 @@ <!-- build a jar file if there are no files in the webapp directory -->
<target name="#package-jar" depends="#check-webapp" unless="#webapp">
- <jar destfile="target/${ant.project.name}.jar"
- basedir="target/classes"/>
+ <antcall target="#create-jar"/>
+ </target>
+
+ <!-- create a jar file with or without a Class-Path attribute -->
+ <target name="#create-jar" depends="#create-jar-path, #create-jar-nopath"/>
+
+ <!-- check whether a dependency path for the package target was specified -->
+ <target name="#check-package-path">
+ <condition property="#package-path">
+ <isreference refid="package-path"/>
+ </condition>
+ </target>
+
+ <!-- create a jar file with a Class-Path attribute -->
+ <target name="#create-jar-path" depends="#check-package-path" if="#package-path">
+ <property name="#parentdir" location=".."/>
+ <pathconvert property="#package-classpath" refid="package-path" pathsep=" " dirsep="/">
+ <map from="${#parentdir}" to="../.."/>
+ </pathconvert>
+ <jar destfile="target/${ant.project.name}.jar" basedir="target/classes">
+ <manifest>
+ <attribute name="Class-Path" value="${#package-classpath}"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <!-- create a jar file without a Class-Path attribute -->
+ <target name="#create-jar-nopath" depends="#check-package-path" unless="#package-path">
+ <jar destfile="target/${ant.project.name}.jar" basedir="target/classes"/>
</target>
<!-- for external use on the ant command line -->
<target name="compile">
<mkdir dir="target/classes"/>
<antcall target="#call-wsdljava"/>
+ <antcall target="#call-idljava"/>
<antcall target="#compile-src"/>
<antcall target="#copy-resources"/>
<antcall target="#call-test"/>
@@ -341,7 +422,10 @@ </target>
<!-- for external use on the ant command line -->
- <target name="package" depends="#package-war, #package-jar"/>
+ <target name="package" depends="#find-javafiles" if="#javafiles">
+ <antcall target="#package-war"/>
+ <antcall target="#package-jar"/>
+ </target>
<!-- for external use on the ant command line -->
<target name="clean">
diff --git a/sandbox/travelsample/build.xml b/sandbox/travelsample/build.xml new file mode 100644 index 0000000000..1555d9ad68 --- /dev/null +++ b/sandbox/travelsample/build.xml @@ -0,0 +1,49 @@ +<!--
+ * 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" default="compile">
+
+ <target name="compile">
+ <antcall target="allsubdirs">
+ <param name="target" value="compile"/>
+ </antcall>
+ </target>
+
+ <target name="test">
+ <antcall target="allsubdirs">
+ <param name="target" value="test"/>
+ </antcall>
+ </target>
+
+ <target name="clean">
+ <antcall target="allsubdirs">
+ <param name="target" value="clean"/>
+ </antcall>
+ </target>
+
+ <target name="allsubdirs">
+ <!--
+ <ant dir="clients" target="${target}"/>
+ -->
+ <ant dir="contributions" target="${target}"/>
+ <ant dir="launchers" target="${target}"/>
+ <ant dir="services" target="${target}"/>
+ </target>
+
+</project>
diff --git a/sandbox/travelsample/clients/pom.xml b/sandbox/travelsample/clients/pom.xml index 5b6a2a5d0b..177da15528 100644 --- a/sandbox/travelsample/clients/pom.xml +++ b/sandbox/travelsample/clients/pom.xml @@ -21,7 +21,7 @@ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-scatours</artifactId>
+ <artifactId>scatours</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/sandbox/travelsample/contributions/payment-bpel/build.xml b/sandbox/travelsample/contributions/payment-bpel/build.xml index 90de52dff3..29e317cf4d 100644 --- a/sandbox/travelsample/contributions/payment-bpel/build.xml +++ b/sandbox/travelsample/contributions/payment-bpel/build.xml @@ -39,7 +39,7 @@ </target>
<property name="test-setup" value="yes"/>
- <target name="test-setup">
+ <target name="testsetup">
<unzip dest="target/test-classes">
<fileset dir="${env.TUSCANY_HOME}/lib">
<include name="ode-dao-jpa-ojpa-derby-*.zip"/>
diff --git a/sandbox/travelsample/contributions/pom.xml b/sandbox/travelsample/contributions/pom.xml index c6ece86582..46699143fb 100644 --- a/sandbox/travelsample/contributions/pom.xml +++ b/sandbox/travelsample/contributions/pom.xml @@ -21,7 +21,7 @@ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-scatours</artifactId>
+ <artifactId>scatours</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/sandbox/travelsample/contributions/trip/build.xml b/sandbox/travelsample/contributions/trip/build.xml index 5731831892..6e48af3cf8 100644 --- a/sandbox/travelsample/contributions/trip/build.xml +++ b/sandbox/travelsample/contributions/trip/build.xml @@ -22,7 +22,5 @@ <path id="compile-path">
<pathelement path="../common/target/scatours-contribution-common.jar"/>
</path>
- <path id="test-path">
- <pathelement path="../common/target/scatours-contribution-common.jar"/>
- </path>
+ <path id="test-path" refid="compile-path"/>
</project>
diff --git a/sandbox/travelsample/distribution/pom.xml b/sandbox/travelsample/distribution/pom.xml index 774cd70f15..614f49b958 100644 --- a/sandbox/travelsample/distribution/pom.xml +++ b/sandbox/travelsample/distribution/pom.xml @@ -2,7 +2,7 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-scatours</artifactId> + <artifactId>scatours</artifactId> <version>1.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/sandbox/travelsample/launchers/blog-feed/build.xml b/sandbox/travelsample/launchers/blog-feed/build.xml index d243ed2dba..fff8bc212f 100644 --- a/sandbox/travelsample/launchers/blog-feed/build.xml +++ b/sandbox/travelsample/launchers/blog-feed/build.xml @@ -18,31 +18,18 @@ -->
<project name="scatours-launcher-blog-feed" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
<target name="run">
<java classname="scatours.BlogFeedLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/build.xml b/sandbox/travelsample/launchers/build.xml new file mode 100644 index 0000000000..b080b2c473 --- /dev/null +++ b/sandbox/travelsample/launchers/build.xml @@ -0,0 +1,67 @@ +<!--
+ * 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-launchers" default="compile">
+
+ <target name="compile">
+ <antcall target="allsubdirs">
+ <param name="target" value="compile"/>
+ </antcall>
+ </target>
+
+ <target name="test">
+ <antcall target="allsubdirs">
+ <param name="target" value="test"/>
+ </antcall>
+ </target>
+
+ <target name="clean">
+ <antcall target="allsubdirs">
+ <param name="target" value="clean"/>
+ </antcall>
+ </target>
+
+ <target name="allsubdirs">
+ <ant dir="common" target="${target}"/> <!--needed by blog-feed-->
+ <ant dir="blog-feed" target="${target}"/>
+ <ant dir="currency-converter" target="${target}"/>
+ <ant dir="currency-converter-corba" target="${target}"/>
+ <ant dir="currency-converter-jms" target="${target}"/>
+ <ant dir="currency-converter-rmi" target="${target}"/>
+ <ant dir="currency-converter-ws" target="${target}"/>
+ <ant dir="databinding" target="${target}"/>
+ <ant dir="feed-logger" target="${target}"/>
+ <ant dir="fullapp" target="${target}"/>
+ <ant dir="fullapp-domain" target="${target}"/>
+ <ant dir="fullapp-nodes" target="${target}"/>
+ <ant dir="help-pages" target="${target}"/>
+ <ant dir="interaction" target="${target}"/>
+ <ant dir="introducing" target="${target}"/>
+ <ant dir="introducing-client" target="${target}"/>
+ <ant dir="introducing-domain" target="${target}"/>
+ <ant dir="jumpstart" target="${target}"/>
+ <ant dir="notification-corba" target="${target}"/>
+ <ant dir="notification-ejb" target="${target}"/>
+ <ant dir="notification-jms" target="${target}"/>
+ <ant dir="notification-rmi" target="${target}"/>
+ <ant dir="notification-ws" target="${target}"/>
+ <ant dir="policy" target="${target}"/>
+ </target>
+
+</project>
diff --git a/sandbox/travelsample/launchers/common/build.xml b/sandbox/travelsample/launchers/common/build.xml new file mode 100644 index 0000000000..c56323c786 --- /dev/null +++ b/sandbox/travelsample/launchers/common/build.xml @@ -0,0 +1,22 @@ +<!--
+ * 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-launcher-common" default="compile">
+ <import file="../../antdefs.xml"/>
+</project>
diff --git a/sandbox/travelsample/launchers/currency-converter-corba/build.xml b/sandbox/travelsample/launchers/currency-converter-corba/build.xml index 1dca0a680d..36012e293a 100644 --- a/sandbox/travelsample/launchers/currency-converter-corba/build.xml +++ b/sandbox/travelsample/launchers/currency-converter-corba/build.xml @@ -18,33 +18,27 @@ -->
<project name="scatours-launcher-currency-converter-corba" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
+ <!-- When running this sample, the tuscany-host-corba-jse and
+ tuscany-host-corba-jse-tns jars need to be present on the classpath.
+ These aren't included in tuscany-sca-manifest so they need to be
+ added to the classpath explicitly. For some reason these jars aren't
+ part of the Tuscany binary distribution so you'll need to download
+ them from the maven repository http://repo1.maven.org/maven2 and set
+ the TUSCANY_HOST_CORBA environment variable to the name of your local
+ download directory. -->
<target name="run">
<java classname="scatours.CurrencyConverterCORBALauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY_HOST_CORBA}/tuscany-host-corba-jse-tns.jar"/>
- <pathelement location="${env.TUSCANY_HOST_CORBA}/tuscany-host-corba-jse.jar"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ <fileset dir="${env.TUSCANY_HOST_CORBA}"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/currency-converter-jms/build.xml b/sandbox/travelsample/launchers/currency-converter-jms/build.xml index d5db4633a3..264e028dd1 100644 --- a/sandbox/travelsample/launchers/currency-converter-jms/build.xml +++ b/sandbox/travelsample/launchers/currency-converter-jms/build.xml @@ -18,23 +18,20 @@ -->
<project name="scatours-launcher-currency-converter-jms" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
+ <!-- Before invoking the "run" target, the JMS broker needs to be
+ started and running in a different process. -->
<target name="run-broker">
<java classname="scatours.JMSBrokerLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <!-- The following is used to bring in the ActiveMQ runtime. -->
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
@@ -42,16 +39,9 @@ <target name="run">
<java classname="scatours.CurrencyConverterJMSLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/currency-converter-rmi/build.xml b/sandbox/travelsample/launchers/currency-converter-rmi/build.xml index 1d2fc52a26..814ed9a053 100644 --- a/sandbox/travelsample/launchers/currency-converter-rmi/build.xml +++ b/sandbox/travelsample/launchers/currency-converter-rmi/build.xml @@ -18,31 +18,18 @@ -->
<project name="scatours-launcher-currency-converter-rmi" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
<target name="run">
<java classname="scatours.CurrencyConverterRMILauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/currency-converter-ws/build.xml b/sandbox/travelsample/launchers/currency-converter-ws/build.xml index 2fc1b8caf5..f4b21d0b55 100644 --- a/sandbox/travelsample/launchers/currency-converter-ws/build.xml +++ b/sandbox/travelsample/launchers/currency-converter-ws/build.xml @@ -18,31 +18,18 @@ -->
<project name="scatours-launcher-currency-converter-ws" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
<target name="run">
<java classname="scatours.CurrencyConverterWSLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/currency-converter/build.xml b/sandbox/travelsample/launchers/currency-converter/build.xml index 7f1e5646d5..6b0f17f2db 100644 --- a/sandbox/travelsample/launchers/currency-converter/build.xml +++ b/sandbox/travelsample/launchers/currency-converter/build.xml @@ -18,31 +18,18 @@ -->
<project name="scatours-launcher-currency-converter" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
<target name="run">
<java classname="scatours.CurrencyConverterLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/databinding/build.xml b/sandbox/travelsample/launchers/databinding/build.xml index 5c1e4a1eea..3d80a6ca68 100644 --- a/sandbox/travelsample/launchers/databinding/build.xml +++ b/sandbox/travelsample/launchers/databinding/build.xml @@ -18,31 +18,18 @@ --> <project name="scatours-launcher-databinding" 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> - </target> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../common/target/scatours-launcher-common.jar"/> + </path> + <path id="package-path" refid="compile-path"/> <target name="run"> <java classname="scatours.DatabindingLauncher" fork="true"> <classpath> - <pathelement location="target/classes"/> - <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/> + <pathelement location="target/${ant.project.name}.jar"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> </classpath> </java> </target> - - <target name="clean"> - <delete includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> - </project> diff --git a/sandbox/travelsample/launchers/feed-logger/build.xml b/sandbox/travelsample/launchers/feed-logger/build.xml index e772c2f67a..e6bca9c15d 100644 --- a/sandbox/travelsample/launchers/feed-logger/build.xml +++ b/sandbox/travelsample/launchers/feed-logger/build.xml @@ -18,31 +18,18 @@ -->
<project name="scatours-launcher-feed-logger" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
<target name="run">
<java classname="scatours.FeedLoggerLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/fullapp-domain/build.xml b/sandbox/travelsample/launchers/fullapp-domain/build.xml index 92957b88ab..1befc6413f 100644 --- a/sandbox/travelsample/launchers/fullapp-domain/build.xml +++ b/sandbox/travelsample/launchers/fullapp-domain/build.xml @@ -18,20 +18,37 @@ -->
<project name="scatours-launcher-fullapp-domain" default="run">
- <property environment="env"/>
+ <import file="../../antdefs.xml"/>
+ <!-- In Tuscany 1.5.1 the command-line launcher for the domain manager
+ is hard wired to use the current directory for the domain configuration,
+ so we use a custom launcher to override this setting using the domain
+ manager API. Note that the classpath only includes the node launcher
+ jar which will bootstrap the rest of the Tuscany runtime. -->
<target name="run">
- <java classname="org.apache.tuscany.sca.node.launcher.DomainManagerLauncher"
- dir="." fork="true">
+ <java classname="scatours.FullAppDomainLauncher" fork="true">
<classpath>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <fileset dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-node-launcher-*.jar"/>
+ </fileset>
</classpath>
- <arg value="./target/classes"/>
</java>
</target>
- <target name="clean">
- <delete dir="./target"/>
+ <!-- The "run-command" target runs the DomainManagerLauncher class
+ directly (as if it had been invoked from a command line) and passes
+ in the domain configuration directory as a command-line argument.
+ This only works for Tuscany versions greater than 1.5.1. -->
+ <target name="run-command">
+ <java classname="org.apache.tuscany.sca.node.launcher.DomainManagerLauncher"
+ dir="." fork="true">
+ <classpath>
+ <fileset dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-node-launcher-*.jar"/>
+ </fileset>
+ </classpath>
+ <arg value=".\target\classes"/>
+ </java>
</target>
-
</project>
diff --git a/sandbox/travelsample/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java b/sandbox/travelsample/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java index 8dfbc947c8..21b0ae4cb3 100644 --- a/sandbox/travelsample/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java +++ b/sandbox/travelsample/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java @@ -39,5 +39,6 @@ public class FullAppDomainLauncher { } catch (IOException e) { } + dm.getClass().getMethod("stop").invoke(dm); } } diff --git a/sandbox/travelsample/launchers/fullapp-nodes/build.xml b/sandbox/travelsample/launchers/fullapp-nodes/build.xml index c34d22faad..14a483b564 100644 --- a/sandbox/travelsample/launchers/fullapp-nodes/build.xml +++ b/sandbox/travelsample/launchers/fullapp-nodes/build.xml @@ -17,37 +17,15 @@ * under the License. --> -<project name="scatours-launcher-fullapp-nodes" default="run"> - <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> - <jar destfile="target/scatours-launcher-fullapp-nodes.jar" basedir="target/classes"> - <manifest> - <attribute name="Main-Class" value="scatours.FullAppNodesLauncher"/> - </manifest> - </jar> - </target> +<project name="scatours-launcher-fullapp-nodes" default="compile"> + <import file="../../antdefs.xml"/> <target name="run"> <java classname="scatours.FullAppNodesLauncher" fork="true"> <classpath> - <pathelement location="target/classes"/> - <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/> + <pathelement location="target/${ant.project.name}.jar"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> </classpath> </java> </target> - - <target name="clean"> - <delete includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> - </project> diff --git a/sandbox/travelsample/launchers/fullapp/build.xml b/sandbox/travelsample/launchers/fullapp/build.xml index 8061df32e3..d6e7e18dbb 100644 --- a/sandbox/travelsample/launchers/fullapp/build.xml +++ b/sandbox/travelsample/launchers/fullapp/build.xml @@ -18,39 +18,18 @@ --> <project name="scatours-launcher-fullapp" 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-launcher-fullapp.jar" basedir="target/classes"> - <manifest> - <attribute name="Main-Class" value="scatours.FullAppLauncher"/> - </manifest> - </jar> - </target> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../common/target/scatours-launcher-common.jar"/> + </path> + <path id="package-path" refid="compile-path"/> <target name="run"> <java classname="scatours.FullAppLauncher" fork="true"> <classpath> - <pathelement location="target/classes"/> - <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/> + <pathelement location="target/${ant.project.name}.jar"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> </classpath> </java> </target> - - <target name="clean"> - <delete includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> - </project> diff --git a/sandbox/travelsample/launchers/help-pages/build.xml b/sandbox/travelsample/launchers/help-pages/build.xml index 2bbb462dca..3f83d64e22 100644 --- a/sandbox/travelsample/launchers/help-pages/build.xml +++ b/sandbox/travelsample/launchers/help-pages/build.xml @@ -18,31 +18,18 @@ -->
<project name="scatours-launcher-help-pages" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
<target name="run">
<java classname="scatours.HelpPagesLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/interaction/build.xml b/sandbox/travelsample/launchers/interaction/build.xml index 5a9591b712..e00596f636 100644 --- a/sandbox/travelsample/launchers/interaction/build.xml +++ b/sandbox/travelsample/launchers/interaction/build.xml @@ -18,31 +18,18 @@ -->
<project name="scatours-launcher-interaction" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
<target name="run">
<java classname="scatours.InteractionLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/introducing-client/build.xml b/sandbox/travelsample/launchers/introducing-client/build.xml index 51444507a8..4cd4a902f8 100644 --- a/sandbox/travelsample/launchers/introducing-client/build.xml +++ b/sandbox/travelsample/launchers/introducing-client/build.xml @@ -18,31 +18,14 @@ -->
<project name="scatours-launcher-introducing-client" 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>
- </target>
+ <import file="../../antdefs.xml"/>
<target name="run">
<java classname="scatours.IntroducingClientLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/introducing-domain/build.xml b/sandbox/travelsample/launchers/introducing-domain/build.xml index 55334cf658..67d5fab24c 100644 --- a/sandbox/travelsample/launchers/introducing-domain/build.xml +++ b/sandbox/travelsample/launchers/introducing-domain/build.xml @@ -18,19 +18,16 @@ -->
<project name="scatours-launcher-introducing-domain" default="run">
- <property environment="env"/>
+ <import file="../../antdefs.xml"/>
- <target name="run">
+ <target name="run" depends="compile">
<java classname="org.apache.tuscany.sca.node.launcher.DomainManagerLauncher"
dir="target/classes" fork="true">
<classpath>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <fileset dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-node-launcher-*.jar"/>
+ </fileset>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete dir="./target"/>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/introducing-tours/build.xml b/sandbox/travelsample/launchers/introducing-tours/build.xml index 2a2d774177..12482cf7b8 100644 --- a/sandbox/travelsample/launchers/introducing-tours/build.xml +++ b/sandbox/travelsample/launchers/introducing-tours/build.xml @@ -24,9 +24,10 @@ <java classname="org.apache.tuscany.sca.node.launcher.NodeLauncher" fork="true">
<arg value="http://localhost:9990/node-config/ToursNode"/>
<classpath>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <fileset dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-node-launcher-*.jar"/>
+ </fileset>
</classpath>
</java>
</target>
-
</project>
diff --git a/sandbox/travelsample/launchers/introducing-trips/build.xml b/sandbox/travelsample/launchers/introducing-trips/build.xml index d0a9623966..463831c948 100644 --- a/sandbox/travelsample/launchers/introducing-trips/build.xml +++ b/sandbox/travelsample/launchers/introducing-trips/build.xml @@ -24,9 +24,10 @@ <java classname="org.apache.tuscany.sca.node.launcher.NodeLauncher" fork="true">
<arg value="http://localhost:9990/node-config/TripsNode"/>
<classpath>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <fileset dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-node-launcher-*.jar"/>
+ </fileset>
</classpath>
</java>
</target>
-
</project>
diff --git a/sandbox/travelsample/launchers/introducing/build.xml b/sandbox/travelsample/launchers/introducing/build.xml index 7cf57f6217..3e3e839610 100644 --- a/sandbox/travelsample/launchers/introducing/build.xml +++ b/sandbox/travelsample/launchers/introducing/build.xml @@ -18,31 +18,18 @@ -->
<project name="scatours-launcher-introducing" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
<target name="run">
<java classname="scatours.IntroducingLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/jumpstart/build.xml b/sandbox/travelsample/launchers/jumpstart/build.xml index 36de2730b2..fdfc12c92d 100644 --- a/sandbox/travelsample/launchers/jumpstart/build.xml +++ b/sandbox/travelsample/launchers/jumpstart/build.xml @@ -18,36 +18,18 @@ -->
<project name="scatours-launcher-jumpstart" 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>
- <jar destfile="target/scatours-launcher-jumpstart.jar" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="scatours.JumpstartLauncher"/>
- </manifest>
- </jar>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
<target name="run">
<java classname="scatours.JumpstartLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/notification-corba/build.xml b/sandbox/travelsample/launchers/notification-corba/build.xml index b931f708d1..152918616a 100644 --- a/sandbox/travelsample/launchers/notification-corba/build.xml +++ b/sandbox/travelsample/launchers/notification-corba/build.xml @@ -18,39 +18,36 @@ -->
<project name="scatours-launcher-notification-corba" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
+ <!-- Before invoking the "run" target, both the CORBA nameserver and
+ the CORBA SMS Gateway service need to be started and running in
+ different processes. -->
<target name="run-nameserver">
- <exec executable="${env.JAVA_HOME}/bin/tnameserv">
- <arg value="-ORBInitialPort"/>
- <arg value="5080"/>
- </exec>
+ <ant dir="../../services/smsgateway-corba" target="run-nameserver"/>
+ </target>
+ <target name="run-smsgateway">
+ <ant dir="../../services/smsgateway-corba" target="run"/>
</target>
+ <!-- When running this sample, the tuscany-host-corba-jse jar needs to be
+ present on the classpath. This isn't included in tuscany-sca-manifest
+ so it needs to be added to the classpath explicitly. For some reason
+ this jar isn't part of the Tuscany binary distribution so you'll need
+ to download it from the maven repository http://repo1.maven.org/maven2
+ and set the TUSCANY_HOST_CORBA environment variable to the name of
+ your local download directory. -->
<target name="run">
<java classname="scatours.NotificationCORBALauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY_HOST_CORBA}/tuscany-host-corba-jse.jar"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ <fileset dir="${env.TUSCANY_HOST_CORBA}"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/notification-ejb/build.xml b/sandbox/travelsample/launchers/notification-ejb/build.xml index 27d9ab92cd..cc7e8466d8 100644 --- a/sandbox/travelsample/launchers/notification-ejb/build.xml +++ b/sandbox/travelsample/launchers/notification-ejb/build.xml @@ -18,31 +18,25 @@ -->
<project name="scatours-launcher-notification-ejb" default="compile">
- <property environment="env"/>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
- <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>
+ <!-- Before invoking the "run" target, the EJB server for the SMS Gateway EJB
+ needs to be started and running in a different process. -->
+ <target name="run-smsgateway">
+ <ant dir="../../services/smsgateway-ejb" target="run"/>
</target>
<target name="run">
<java classname="scatours.NotificationEJBLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ <fileset dir="${env.OPENEJB_HOME}/lib"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/notification-jms/build.xml b/sandbox/travelsample/launchers/notification-jms/build.xml index 1a0130aa82..0c1c4d2063 100644 --- a/sandbox/travelsample/launchers/notification-jms/build.xml +++ b/sandbox/travelsample/launchers/notification-jms/build.xml @@ -18,40 +18,28 @@ -->
<project name="scatours-launcher-notification-jms" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
+ <!-- Before invoking the "run" target, both the JMS broker and the
+ JMS implementation of the SMS gateway need to be started and running
+ in different processes. -->
<target name="run-broker">
- <java classname="scatours.JMSBrokerLauncher" fork="true">
- <classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
- </classpath>
- </java>
+ <ant dir="../../services/smsgateway-jms" target="run-broker"/>
+ </target>
+ <target name="run-smsgateway">
+ <ant dir="../../services/smsgateway-jms" target="run"/>
</target>
<target name="run">
<java classname="scatours.NotificationJMSLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/notification-rmi/build.xml b/sandbox/travelsample/launchers/notification-rmi/build.xml index 70b5b18f77..addffd998e 100644 --- a/sandbox/travelsample/launchers/notification-rmi/build.xml +++ b/sandbox/travelsample/launchers/notification-rmi/build.xml @@ -18,31 +18,24 @@ -->
<project name="scatours-launcher-notification-rmi" default="compile">
- <property environment="env"/>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
- <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>
+ <!-- Before invoking the "run" target, the RMI server for the SMS Gateway
+ remote object needs to be started and running in a different process. -->
+ <target name="run-smsgateway">
+ <ant dir="../../services/smsgateway-rmi" target="run"/>
</target>
<target name="run">
<java classname="scatours.NotificationRMILauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/services/smsgateway-rmi/src/main/java/scatours/smsgateway/SMSGateway.java b/sandbox/travelsample/launchers/notification-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java index e6e866fa1d..4ce528fd23 100644 --- a/sandbox/travelsample/services/smsgateway-rmi/src/main/java/scatours/smsgateway/SMSGateway.java +++ b/sandbox/travelsample/launchers/notification-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java @@ -17,7 +17,7 @@ * under the License. */ -package scatours.smsgateway; +package com.tuscanyscatours.smsgateway; import java.rmi.Remote; import java.rmi.RemoteException; diff --git a/sandbox/travelsample/launchers/notification-ws/build.xml b/sandbox/travelsample/launchers/notification-ws/build.xml index 8be5783cb3..dff087b710 100644 --- a/sandbox/travelsample/launchers/notification-ws/build.xml +++ b/sandbox/travelsample/launchers/notification-ws/build.xml @@ -18,31 +18,18 @@ -->
<project name="scatours-launcher-notification-ws" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../common/target/scatours-launcher-common.jar"/>
+ </path>
+ <path id="package-path" refid="compile-path"/>
<target name="run">
<java classname="scatours.NotificationWSLauncher" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/policy/build.xml b/sandbox/travelsample/launchers/policy/build.xml index ec8155b871..2e670f6983 100644 --- a/sandbox/travelsample/launchers/policy/build.xml +++ b/sandbox/travelsample/launchers/policy/build.xml @@ -18,31 +18,18 @@ --> <project name="scatours-launcher-policy" 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> - </target> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../common/target/scatours-launcher-common.jar"/> + </path> + <path id="package-path" refid="compile-path"/> <target name="run"> <java classname="scatours.PolicyLauncher" fork="true"> <classpath> - <pathelement location="target/classes"/> - <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/> + <pathelement location="target/${ant.project.name}.jar"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> </classpath> </java> </target> - - <target name="clean"> - <delete includeemptydirs="true"> - <fileset dir="target"/> - </delete> - </target> - </project> diff --git a/sandbox/travelsample/launchers/pom.xml b/sandbox/travelsample/launchers/pom.xml index a6191b4089..2e23f03b30 100644 --- a/sandbox/travelsample/launchers/pom.xml +++ b/sandbox/travelsample/launchers/pom.xml @@ -21,7 +21,7 @@ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-scatours</artifactId>
+ <artifactId>scatours</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/sandbox/travelsample/pom.xml b/sandbox/travelsample/pom.xml index cae4ff4542..35a63d0929 100644 --- a/sandbox/travelsample/pom.xml +++ b/sandbox/travelsample/pom.xml @@ -24,10 +24,10 @@ <artifactId>tuscany-sca</artifactId> <version>1.6-SNAPSHOT</version> </parent> - <artifactId>tuscany-scatours</artifactId> + <artifactId>scatours</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> - <name>Apache Tuscany SCA Tours Assembly Examples</name> + <name>Apache Tuscany SCA Tours Travel Sample</name> <repositories> <repository> diff --git a/sandbox/travelsample/services/build.xml b/sandbox/travelsample/services/build.xml new file mode 100644 index 0000000000..21b282707c --- /dev/null +++ b/sandbox/travelsample/services/build.xml @@ -0,0 +1,49 @@ +<!--
+ * 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-services" default="compile">
+
+ <target name="compile">
+ <antcall target="allsubdirs">
+ <param name="target" value="compile"/>
+ </antcall>
+ </target>
+
+ <target name="test">
+ <antcall target="allsubdirs">
+ <param name="target" value="test"/>
+ </antcall>
+ </target>
+
+ <target name="clean">
+ <antcall target="allsubdirs">
+ <param name="target" value="clean"/>
+ </antcall>
+ </target>
+
+ <target name="allsubdirs">
+ <ant dir="creditcard-payment-jaxws" target="${target}"/>
+ <ant dir="smsgateway-corba" target="${target}"/>
+ <ant dir="smsgateway-ejb" target="${target}"/>
+ <ant dir="smsgateway-jaxws" target="${target}"/>
+ <ant dir="smsgateway-jms" target="${target}"/>
+ <ant dir="smsgateway-rmi" target="${target}"/>
+ </target>
+
+</project>
diff --git a/sandbox/travelsample/services/creditcard-payment-jaxws/build.xml b/sandbox/travelsample/services/creditcard-payment-jaxws/build.xml index 086f13825c..515df819c3 100644 --- a/sandbox/travelsample/services/creditcard-payment-jaxws/build.xml +++ b/sandbox/travelsample/services/creditcard-payment-jaxws/build.xml @@ -18,31 +18,14 @@ -->
<project name="scatours-service-creditcard-payment-jaxws" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <!-- The "run" target starts a JAX-WS service endpoint for a simple
+ credit card payment service. This endpoint does not appear to be
+ used currently anywhere else in the travel application. -->
<target name="run">
- <java classname="creditcard.CreditCardServiceBootstrap" fork="true">
- <classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
- </classpath>
+ <java classname="scatours.creditcard.CreditCardServiceBootstrap" fork="true">
+ <classpath location="target/${ant.project.name}.jar"/>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/services/pom.xml b/sandbox/travelsample/services/pom.xml index f625fe5e8e..0c8812cffd 100644 --- a/sandbox/travelsample/services/pom.xml +++ b/sandbox/travelsample/services/pom.xml @@ -21,7 +21,7 @@ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-scatours</artifactId>
+ <artifactId>scatours</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
diff --git a/sandbox/travelsample/services/smsgateway-corba/build.xml b/sandbox/travelsample/services/smsgateway-corba/build.xml index ae2939131c..b56445a129 100644 --- a/sandbox/travelsample/services/smsgateway-corba/build.xml +++ b/sandbox/travelsample/services/smsgateway-corba/build.xml @@ -18,31 +18,27 @@ -->
<project name="scatours-service-smsgateway-corba" default="compile">
- <property environment="env"/>
+ <import file="../../antdefs.xml"/>
- <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>
+ <target name="idljava">
+ <antcall target="idlj">
+ <param name="idlfile" value="sms-gateway.idl"/>
+ <param name="javaclass" value="scatours/smsgateway/SMSGatewayPOA.class"/>
+ </antcall>
</target>
- <target name="run">
- <java classname="scatours.smsgateway.SMSGatewayCORBAServiceBootstrap" fork="true">
- <classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
- </classpath>
- </java>
+ <!-- Before invoking the "run" target, the CORBA nameserver needs to be
+ started and running in a different process. -->
+ <target name="run-nameserver">
+ <exec executable="${env.JAVA_HOME}/bin/tnameserv">
+ <arg value="-ORBInitialPort"/>
+ <arg value="5080"/>
+ </exec>
</target>
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
+ <target name="run">
+ <java classname="scatours.smsgateway.SMSGatewayCORBAServiceBootstrap" fork="true">
+ <classpath location="target/${ant.project.name}.jar"/>
+ </java>
</target>
-
</project>
diff --git a/sandbox/travelsample/services/smsgateway-ejb/build.xml b/sandbox/travelsample/services/smsgateway-ejb/build.xml index 36630cedee..cd08a865dc 100644 --- a/sandbox/travelsample/services/smsgateway-ejb/build.xml +++ b/sandbox/travelsample/services/smsgateway-ejb/build.xml @@ -18,31 +18,17 @@ -->
<project name="scatours-service-smsgateway-ejb" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <!-- The "run" target starts an OpenEJB service endpoint for the
+ SMS gateway service. This endpoint is used by the "run" target
+ of the notification-ejb launcher. -->
<target name="run">
- <java classname="scatours.smsgateway.SMSGatewayEJBServiceBootstrap" fork="true">
+ <java classname="com.tuscanyscatours.smsgateway.SMSGatewayEJBServiceBootstrap" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <fileset dir="${env.OPENEJB_HOME}/lib"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/services/smsgateway-ejb/src/main/java/scatours/smsgateway/SMSGateway.java b/sandbox/travelsample/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java index 70f1191596..b462dd1be8 100644 --- a/sandbox/travelsample/services/smsgateway-ejb/src/main/java/scatours/smsgateway/SMSGateway.java +++ b/sandbox/travelsample/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java @@ -17,7 +17,7 @@ * under the License. */ -package scatours.smsgateway; +package com.tuscanyscatours.smsgateway; import javax.ejb.Remote; diff --git a/sandbox/travelsample/services/smsgateway-ejb/src/main/java/scatours/smsgateway/SMSGatewayEJBServiceBootstrap.java b/sandbox/travelsample/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayEJBServiceBootstrap.java index 5c1a61f4dc..4da784bc55 100644 --- a/sandbox/travelsample/services/smsgateway-ejb/src/main/java/scatours/smsgateway/SMSGatewayEJBServiceBootstrap.java +++ b/sandbox/travelsample/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayEJBServiceBootstrap.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations
* under the License.
*/
-package scatours.smsgateway;
+package com.tuscanyscatours.smsgateway;
import java.util.Properties;
diff --git a/sandbox/travelsample/services/smsgateway-ejb/src/main/java/scatours/smsgateway/SMSGatewayImpl.java b/sandbox/travelsample/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.java index 5ce94bf3a2..3bdf48a7ea 100644 --- a/sandbox/travelsample/services/smsgateway-ejb/src/main/java/scatours/smsgateway/SMSGatewayImpl.java +++ b/sandbox/travelsample/services/smsgateway-ejb/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations
* under the License.
*/
-package scatours.smsgateway;
+package com.tuscanyscatours.smsgateway;
import javax.ejb.Stateless;
diff --git a/sandbox/travelsample/services/smsgateway-jaxws/build.xml b/sandbox/travelsample/services/smsgateway-jaxws/build.xml index 1cb7f3c930..be9830cc1b 100644 --- a/sandbox/travelsample/services/smsgateway-jaxws/build.xml +++ b/sandbox/travelsample/services/smsgateway-jaxws/build.xml @@ -18,31 +18,14 @@ -->
<project name="scatours-service-smsgateway-jaxws" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <!-- The "run" target starts a JAX-WS service endpoint for the
+ SMS gateway service. This endpoint is used by the "run" target
+ of the notification-ws launcher. -->
<target name="run">
<java classname="com.tuscanyscatours.smsgateway.SMSGatewayServiceBootstrap" fork="true">
- <classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
- </classpath>
+ <classpath location="target/${ant.project.name}.jar"/>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java b/sandbox/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java index e63f248c1e..6631aee907 100644 --- a/sandbox/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java +++ b/sandbox/travelsample/services/smsgateway-jaxws/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayServiceBootstrap.java @@ -23,7 +23,7 @@ import javax.xml.ws.Endpoint; public class SMSGatewayServiceBootstrap {
public static void main(String[] args) {
- System.out.println("Publishing SMS Gateway Service as web service: http://localhost:8081/CreditCardService");
+ System.out.println("Publishing SMS Gateway Service as web service: http://localhost:8081/SMSGatewayService");
System.out.println("Press Ctrl^C to terminate...");
Endpoint.publish("http://localhost:8081/SMSGatewayService", new SMSGatewayServiceImpl());
diff --git a/sandbox/travelsample/services/smsgateway-jms/build.xml b/sandbox/travelsample/services/smsgateway-jms/build.xml index 1bd42894db..fe7e66111e 100644 --- a/sandbox/travelsample/services/smsgateway-jms/build.xml +++ b/sandbox/travelsample/services/smsgateway-jms/build.xml @@ -18,31 +18,30 @@ -->
<project name="scatours-service-smsgateway-jms" default="compile">
- <property environment="env"/>
+ <import file="../../antdefs.xml"/>
- <target name="compile">
- <mkdir dir="target/classes"/>
- <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
- <src path="src/main/java"/>
+ <!-- Before invoking the "run" target, the JMS broker needs to be
+ started and running in a different process. -->
+ <target name="run-broker">
+ <java classname="scatours.JMSBrokerLauncher" fork="true">
<classpath>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <!-- The following is used to bring in the ActiveMQ runtime. -->
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
- </javac>
+ </java>
</target>
+ <!-- The "run" target creates JMS request and response queues for the
+ SMS gateway service. These queues are used by the "run" target of
+ the notification-jms launcher. -->
<target name="run">
<java classname="scatours.smsgateway.SMSGatewayJMSServiceBootstrap" fork="true">
<classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <!-- The following is used to bring in the ActiveMQ runtime. -->
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
</classpath>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/launchers/notification-jms/src/main/java/scatours/JMSBrokerLauncher.java b/sandbox/travelsample/services/smsgateway-jms/src/main/java/scatours/JMSBrokerLauncher.java index 929eb78431..929eb78431 100644 --- a/sandbox/travelsample/launchers/notification-jms/src/main/java/scatours/JMSBrokerLauncher.java +++ b/sandbox/travelsample/services/smsgateway-jms/src/main/java/scatours/JMSBrokerLauncher.java diff --git a/sandbox/travelsample/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayJMSServiceBootstrap.java b/sandbox/travelsample/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayJMSServiceBootstrap.java index d27635f0c3..b4effa6f82 100644 --- a/sandbox/travelsample/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayJMSServiceBootstrap.java +++ b/sandbox/travelsample/services/smsgateway-jms/src/main/java/scatours/smsgateway/SMSGatewayJMSServiceBootstrap.java @@ -27,6 +27,7 @@ public class SMSGatewayJMSServiceBootstrap { public static void main(String[] args) throws Exception {
System.out.println("Publishing SMS Gateway Service as a JMS service: tcp://localhost:61619");
+ System.out.println("Press Ctrl^C to terminate...");
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61619");
Connection connection = connectionFactory.createConnection();
diff --git a/sandbox/travelsample/services/smsgateway-rmi/build.xml b/sandbox/travelsample/services/smsgateway-rmi/build.xml index 5a2e7d1aac..2b43ed15db 100644 --- a/sandbox/travelsample/services/smsgateway-rmi/build.xml +++ b/sandbox/travelsample/services/smsgateway-rmi/build.xml @@ -18,31 +18,13 @@ -->
<project name="scatours-service-smsgateway-rmi" 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>
- </target>
+ <import file="../../antdefs.xml"/>
+ <!-- The "run" target starts an RMI server for the SMS gateway service.
+ This server is used by the "run" target of the notification-rmi launcher. -->
<target name="run">
- <java classname="scatours.smsgateway.SMSGatewayRMIServiceBootstrap" fork="true">
- <classpath>
- <pathelement location="target/classes"/>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
- </classpath>
+ <java classname="com.tuscanyscatours.smsgateway.SMSGatewayRMIServiceBootstrap" fork="true">
+ <classpath location="target/${ant.project.name}.jar"/>
</java>
</target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
</project>
diff --git a/sandbox/travelsample/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java b/sandbox/travelsample/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java new file mode 100644 index 0000000000..4ce528fd23 --- /dev/null +++ b/sandbox/travelsample/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java @@ -0,0 +1,30 @@ +/* + * 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 com.tuscanyscatours.smsgateway; + +import java.rmi.Remote; +import java.rmi.RemoteException; + +/** + * A gateway to send SMS messages. + */ +public interface SMSGateway extends Remote { + boolean sendSMS(String fromNumber, String toNumber, String text) throws RemoteException; +} diff --git a/sandbox/travelsample/services/smsgateway-rmi/src/main/java/scatours/smsgateway/SMSGatewayImpl.java b/sandbox/travelsample/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.java index 0ac8cd4293..c33439af8b 100644 --- a/sandbox/travelsample/services/smsgateway-rmi/src/main/java/scatours/smsgateway/SMSGatewayImpl.java +++ b/sandbox/travelsample/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayImpl.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations
* under the License.
*/
-package scatours.smsgateway;
+package com.tuscanyscatours.smsgateway;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
diff --git a/sandbox/travelsample/services/smsgateway-rmi/src/main/java/scatours/smsgateway/SMSGatewayRMIServiceBootstrap.java b/sandbox/travelsample/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayRMIServiceBootstrap.java index b13f3d2aee..5b223fb40c 100644 --- a/sandbox/travelsample/services/smsgateway-rmi/src/main/java/scatours/smsgateway/SMSGatewayRMIServiceBootstrap.java +++ b/sandbox/travelsample/services/smsgateway-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGatewayRMIServiceBootstrap.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations
* under the License.
*/
-package scatours.smsgateway;
+package com.tuscanyscatours.smsgateway;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
diff --git a/sandbox/travelsample/testdomain/build.xml b/sandbox/travelsample/testdomain/build.xml index 40c6689f71..1f8d60a8e3 100644 --- a/sandbox/travelsample/testdomain/build.xml +++ b/sandbox/travelsample/testdomain/build.xml @@ -23,7 +23,9 @@ <target name="run">
<java classname="org.apache.tuscany.sca.node.launcher.DomainManagerLauncher" fork="true">
<classpath>
- <pathelement location="${env.TUSCANY}/lib/tuscany-sca-manifest.jar"/>
+ <fileset dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-node-launcher-*.jar"/>
+ </fileset>
</classpath>
</java>
</target>
|