diff options
Diffstat (limited to '')
198 files changed, 12087 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/blog-feed/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/blog-feed/build.xml new file mode 100644 index 0000000000..f7c4bee524 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/blog-feed/build.xml @@ -0,0 +1,35 @@ +<!--
+ * 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-blog-feed" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <target name="run">
+ <java classname="scatours.BlogFeedLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/blog-feed/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/blog-feed/pom.xml new file mode 100644 index 0000000000..5f36065a5b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/blog-feed/pom.xml @@ -0,0 +1,104 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-blog-feed</artifactId>
+ <name>Apache Tuscany SCA Tours Blog Feed Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-atom-abdera</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rss-rome</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.BlogFeedLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/blog-feed/src/main/java/scatours/BlogFeedLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/blog-feed/src/main/java/scatours/BlogFeedLauncher.java new file mode 100644 index 0000000000..8dc6956986 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/blog-feed/src/main/java/scatours/BlogFeedLauncher.java @@ -0,0 +1,50 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+
+public class BlogFeedLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution feedContribution = locate("blog-feed");
+
+ SCANode node = SCANodeFactory.newInstance().createSCANode("blog-feed.composite", feedContribution);
+ node.start();
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.out.println();
+ System.out.println("To view the blog feed, use your Web browser to view:");
+ System.out.println(" Feeds using Tuscany Data APIs");
+ System.out.println(" http://localhost:8090/BlogAtom");
+ System.out.println(" http://localhost:8090/BlogRSS");
+ System.out.println(" Feeds using Atom APIs");
+ System.out.println(" http://localhost:8090/BlogAtomAPIs");
+ System.out.println(" Feeds using RSS APIs");
+ System.out.println(" http://localhost:8090/BlogRSSAPIs");
+ System.out.println();
+ System.in.read();
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/build.xml new file mode 100644 index 0000000000..2f934ad32e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/build.xml @@ -0,0 +1,79 @@ +<!--
+ * 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="blog-feed" target="${target}"/>
+ <ant dir="buildingblocks" 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="introducing-tours" target="${target}"/>
+ <ant dir="introducing-trips" 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="payment-java" target="${target}"/>
+ <ant dir="payment-java-callback" target="${target}"/>
+ <ant dir="payment-java-policy" target="${target}"/>
+ <ant dir="payment-java-reference-pass" target="${target}"/>
+ <ant dir="payment-spring" target="${target}"/>
+ <ant dir="payment-spring-scatag" target="${target}"/>
+ <ant dir="payment-bpel" target="${target}"/>
+ <ant dir="payment-groovy" target="${target}"/>
+ <ant dir="payment-python" target="${target}"/>
+ <ant dir="policy" target="${target}"/>
+ <ant dir="using" target="${target}"/>
+ </target>
+
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/build.xml new file mode 100644 index 0000000000..b61282f368 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/build.xml @@ -0,0 +1,35 @@ +<!--
+ * 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-buildingblocks" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <target name="run">
+ <java classname="scatours.BuildingBlocksLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/pom.xml new file mode 100644 index 0000000000..b43706c55e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/pom.xml @@ -0,0 +1,131 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-buildingblocks</artifactId>
+ <name>Apache Tuscany SCA Tours Building Blocks Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-all</artifactId>
+ <version>5.2.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-web-demo</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jms-asf</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.BuildingBlocksLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/src/main/java/scatours/BuildingBlocksLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/src/main/java/scatours/BuildingBlocksLauncher.java new file mode 100644 index 0000000000..741b502cf3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/src/main/java/scatours/BuildingBlocksLauncher.java @@ -0,0 +1,84 @@ +/*
+ * 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.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+
+import static scatours.launcher.LauncherUtil.locate;
+
+public class BuildingBlocksLauncher {
+
+ public static void main(String[] args) throws Exception {
+ runImpl();
+ runImplInclude();
+ runAppl();
+ }
+
+ private static void runImpl() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("tours-impl-client.composite",
+ locate("buildingblocks"),
+ locate("buildingblocks-client"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "ToursClient/Runnable");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runImplInclude() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("tours-impl-include-client.composite",
+ locate("introducing-trips"),
+ locate("buildingblocks"),
+ locate("buildingblocks-client"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "ToursClient/Runnable");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runAppl() throws Exception {
+ SCANode node1 =
+ SCANodeFactory.newInstance().createSCANode("tours-appl.composite",
+ locate("introducing-trips"),
+ locate("buildingblocks"));
+
+ SCANode node2 =
+ SCANodeFactory.newInstance().createSCANode("tours-appl-client.composite",
+ locate("buildingblocks-client"));
+
+ node1.start();
+ node2.start();
+
+ Runnable client = ((SCAClient)node2).getService(Runnable.class, "ApplClient/Runnable");
+ client.run();
+
+ node2.stop();
+ node1.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/src/main/resources/jndi.properties b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/src/main/resources/jndi.properties new file mode 100644 index 0000000000..88270fd1e0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/src/main/resources/jndi.properties @@ -0,0 +1,39 @@ +## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.BookTrip = BookTripRequestQueue
+queue.Checkout = CheckoutRequestQueue
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/src/test/java/scatours/BuildingBlocksTestCase.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/src/test/java/scatours/BuildingBlocksTestCase.java new file mode 100644 index 0000000000..55943e2f45 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/buildingblocks/src/test/java/scatours/BuildingBlocksTestCase.java @@ -0,0 +1,42 @@ +/*
+ * 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.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests the launcher
+ */
+public class BuildingBlocksTestCase {
+
+ @Before
+ public void startServer() throws Exception {
+ }
+
+ @Test
+ public void testLauncher() throws Exception {
+ BuildingBlocksLauncher.main(null);
+ }
+
+ @After
+ public void stopServer() throws Exception {
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/build.xml new file mode 100644 index 0000000000..c5f32d4588 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/build.xml @@ -0,0 +1,42 @@ +<!--
+ * 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-currency-converter-corba" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <!-- After starting the SCA CORBA service by invoking the "run" target below,
+ the CORBA Java implementation of the currency converter client should be
+ run in another process using the "run-client" target. -->
+ <target name="run-client">
+ <ant dir="../../clients/currency-converter-corba" target="run"/>
+ </target>
+
+ <target name="run">
+ <java classname="scatours.CurrencyConverterCORBALauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/pom.xml new file mode 100644 index 0000000000..3f48c97f2a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/pom.xml @@ -0,0 +1,97 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-currency-converter-corba</artifactId>
+ <name>Apache Tuscany SCA Tours Currency Converter CORBA Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-corba-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-corba-jse-tns</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.CurrencyConverterCORBALauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBALauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBALauncher.java new file mode 100644 index 0000000000..0f9d0eca80 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/src/main/java/scatours/CurrencyConverterCORBALauncher.java @@ -0,0 +1,52 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+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 scatours.currencyconverter.CurrencyConverter;
+
+public class CurrencyConverterCORBALauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution currencyCORBAContribution = locate("currency-corba");
+ SCAContribution currencyContribution = locate("currency");
+
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("currency-converter-corba.composite",
+ currencyContribution,
+ currencyCORBAContribution);
+ node.start();
+
+ System.out.println("Quick currency converter test");
+ CurrencyConverter converter = ((SCAClient)node).getService(CurrencyConverter.class, "CurrencyConverter");
+ System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP"));
+ System.out.println("100 USD = " + converter.convert("USD", "GBP", 100) + "GBP");
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.in.read();
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/src/main/java/scatours/currencyconverter/CurrencyConverter.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/src/main/java/scatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..fe5c98bf02 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-corba/src/main/java/scatours/currencyconverter/CurrencyConverter.java @@ -0,0 +1,33 @@ +/*
+ * 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.currencyconverter;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The CurrencyConverter service interface
+ */
+@Remotable
+public interface CurrencyConverter {
+
+ double getExchangeRate(String fromCurrencyCode, String toCurrencyCode);
+
+ double convert(String fromCurrencyCode, String toCurrencyCode, double amount);
+
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-jms/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-jms/build.xml new file mode 100644 index 0000000000..3ccf56b2c8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-jms/build.xml @@ -0,0 +1,42 @@ +<!--
+ * 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-currency-converter-jms" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <!-- After starting the SCA JMS service by invoking the "run" target below,
+ the ActiveMQ JMS implementation of the currency converter client should be
+ run in another process using the "run-client" target. -->
+ <target name="run-client">
+ <ant dir="../../clients/currency-converter-jms" target="run"/>
+ </target>
+
+ <target name="run">
+ <java classname="scatours.CurrencyConverterJMSLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-jms/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-jms/pom.xml new file mode 100644 index 0000000000..db54525784 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-jms/pom.xml @@ -0,0 +1,109 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-currency-converter-jms</artifactId>
+ <name>Apache Tuscany SCA Tours Currency Converter JMS Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jms-asf</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-all</artifactId>
+ <version>5.2.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-web-demo</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.CurrencyConverterJMSLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSLauncher.java new file mode 100644 index 0000000000..6da4e7e162 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-jms/src/main/java/scatours/CurrencyConverterJMSLauncher.java @@ -0,0 +1,53 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+
+public class CurrencyConverterJMSLauncher {
+
+ public static void main(String[] args) throws Exception {
+ final BrokerService jmsBroker = new BrokerService();
+ jmsBroker.setPersistent(false);
+ jmsBroker.setUseJmx(false);
+ jmsBroker.addConnector("tcp://localhost:61619");
+ jmsBroker.start();
+
+ SCAContribution currencyJMSContribution = locate("currency-jms");
+ SCAContribution currencyContribution = locate("currency");
+
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("currency-converter-jms.composite",
+ currencyContribution,
+ currencyJMSContribution);
+ node.start();
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.in.read();
+
+ node.stop();
+ jmsBroker.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/build.xml new file mode 100644 index 0000000000..8990723c63 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/build.xml @@ -0,0 +1,42 @@ +<!--
+ * 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-currency-converter-rmi" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <!-- After starting the SCA RMI service by invoking the "run" target below,
+ the RMI Java implementation of the currency converter client should be
+ run in another process using the "run-client" target. -->
+ <target name="run-client">
+ <ant dir="../../clients/currency-converter-rmi" target="run"/>
+ </target>
+
+ <target name="run">
+ <java classname="scatours.CurrencyConverterRMILauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/pom.xml new file mode 100644 index 0000000000..14e4a77e3d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/pom.xml @@ -0,0 +1,104 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-currency-converter-rmi</artifactId>
+ <name>Apache Tuscany SCA Tours Currency Converter RMI Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-rmi</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.CurrencyConverterRMILauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..b1f783bfba --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/src/main/java/com/tuscanyscatours/currencyconverter/CurrencyConverter.java @@ -0,0 +1,33 @@ +/*
+ * 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.currencyconverter;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The CurrencyConverter service interface
+ */
+@Remotable
+public interface CurrencyConverter {
+
+ double getExchangeRate(String fromCurrencyCode, String toCurrencyCode);
+
+ double convert(String fromCurrencyCode, String toCurrencyCode, double amount);
+
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMILauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMILauncher.java new file mode 100644 index 0000000000..81d9e19c60 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-rmi/src/main/java/scatours/CurrencyConverterRMILauncher.java @@ -0,0 +1,56 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+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 com.tuscanyscatours.currencyconverter.CurrencyConverter;
+
+public class CurrencyConverterRMILauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution currencyRMIContribution = locate("currency-rmi");
+ SCAContribution currencyContribution = locate("currency");
+
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("currency-converter-rmi.composite",
+ currencyContribution,
+ currencyRMIContribution);
+ node.start();
+
+ System.out.println("Quick currency converter test");
+ CurrencyConverter converter = ((SCAClient)node).getService(CurrencyConverter.class, "CurrencyConverter");
+ System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP"));
+ System.out.println("100 USD = " + converter.convert("USD", "GBP", 100) + "GBP");
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.in.read();
+ node.stop();
+
+ // The following line is a workaround for TUSCANY-3277 when running
+ // on Tuscany SCA 1.6 (the JVM hangs when exiting).
+ System.exit(0);
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/build.xml new file mode 100644 index 0000000000..2fd3663bab --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/build.xml @@ -0,0 +1,42 @@ +<!--
+ * 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-currency-converter-ws" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <!-- After starting the SCA Web service by invoking the "run" target below,
+ the JAX-WS implementation of the currency converter client should be
+ run in another process using the "run-client" target. -->
+ <target name="run-client">
+ <ant dir="../../clients/currency-converter-ws-jaxws" target="run"/>
+ </target>
+
+ <target name="run">
+ <java classname="scatours.CurrencyConverterWSLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/pom.xml new file mode 100644 index 0000000000..bddb75987a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/pom.xml @@ -0,0 +1,98 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-currency-converter-ws</artifactId>
+ <name>Apache Tuscany SCA Tours Currency Converter Web Service Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.CurrencyConverterWSLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/src/main/java/scatours/CurrencyConverterWSLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/src/main/java/scatours/CurrencyConverterWSLauncher.java new file mode 100644 index 0000000000..2425d3f483 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/src/main/java/scatours/CurrencyConverterWSLauncher.java @@ -0,0 +1,53 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+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 scatours.currencyconverter.CurrencyConverter;
+
+public class CurrencyConverterWSLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution currencyWSContribution = locate("currency-ws");
+ SCAContribution currencyContribution = locate("currency");
+
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("currency-converter-ws.composite",
+ currencyContribution,
+ currencyWSContribution);
+ node.start();
+
+ System.out.println("Quick currency converter test");
+ CurrencyConverter converter = ((SCAClient)node).getService(CurrencyConverter.class, "CurrencyConverter");
+ System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP"));
+ System.out.println("100 USD = " + converter.convert("USD", "GBP", 100) + "GBP");
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.in.read();
+
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/src/main/java/scatours/currencyconverter/CurrencyConverter.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/src/main/java/scatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..fe5c98bf02 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter-ws/src/main/java/scatours/currencyconverter/CurrencyConverter.java @@ -0,0 +1,33 @@ +/*
+ * 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.currencyconverter;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The CurrencyConverter service interface
+ */
+@Remotable
+public interface CurrencyConverter {
+
+ double getExchangeRate(String fromCurrencyCode, String toCurrencyCode);
+
+ double convert(String fromCurrencyCode, String toCurrencyCode, double amount);
+
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/build.xml new file mode 100644 index 0000000000..2cd41af723 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/build.xml @@ -0,0 +1,35 @@ +<!--
+ * 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-currency-converter" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <target name="run">
+ <java classname="scatours.CurrencyConverterLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/pom.xml new file mode 100644 index 0000000000..20cbc7dbff --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/pom.xml @@ -0,0 +1,83 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-currency-converter</artifactId>
+ <name>Apache Tuscany SCA Tours Currency Converter Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.CurrencyConverterLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/src/main/java/scatours/CurrencyConverterLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/src/main/java/scatours/CurrencyConverterLauncher.java new file mode 100644 index 0000000000..cacd579b3b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/src/main/java/scatours/CurrencyConverterLauncher.java @@ -0,0 +1,48 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+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 scatours.currencyconverter.CurrencyConverter;
+
+public class CurrencyConverterLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution currencyContribution = locate("currency");
+
+ SCANode node = SCANodeFactory.newInstance().createSCANode("currency-converter.composite", currencyContribution);
+ node.start();
+
+ System.out.println("Quick currency converter test");
+ CurrencyConverter converter = ((SCAClient)node).getService(CurrencyConverter.class, "CurrencyConverter");
+ System.out.println("USD -> GBP = " + converter.getExchangeRate("USD", "GBP"));
+ System.out.println("100 USD = " + converter.convert("USD", "GBP", 100) + "GBP");
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.in.read();
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/src/main/java/scatours/currencyconverter/CurrencyConverter.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/src/main/java/scatours/currencyconverter/CurrencyConverter.java new file mode 100644 index 0000000000..fe5c98bf02 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/currency-converter/src/main/java/scatours/currencyconverter/CurrencyConverter.java @@ -0,0 +1,33 @@ +/*
+ * 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.currencyconverter;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The CurrencyConverter service interface
+ */
+@Remotable
+public interface CurrencyConverter {
+
+ double getExchangeRate(String fromCurrencyCode, String toCurrencyCode);
+
+ double convert(String fromCurrencyCode, String toCurrencyCode, double amount);
+
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/databinding/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/databinding/build.xml new file mode 100644 index 0000000000..dc099ea479 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/databinding/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-databinding" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.DatabindingLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/databinding/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/databinding/pom.xml new file mode 100644 index 0000000000..7fef1796f7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/databinding/pom.xml @@ -0,0 +1,169 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + <version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-databinding</artifactId> + <name>Apache Tuscany SCA Tours Databinding Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-widget-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-resource-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-atom-abdera</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-http-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-sca-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ejb-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-ejb</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-bpel-ode</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>10.3.1.4</version> + <scope>runtime</scope> + </dependency> + + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.DatabindingLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/databinding/src/main/java/scatours/DatabindingLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/databinding/src/main/java/scatours/DatabindingLauncher.java new file mode 100644 index 0000000000..6271c60d53 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/databinding/src/main/java/scatours/DatabindingLauncher.java @@ -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. + */ + +package scatours; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class DatabindingLauncher { + public static void main(String[] args) throws Exception { + SCANode node1 = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-java"), + locate("databinding-client")); + + SCANode node2 = SCANodeFactory.newInstance().createSCANode(null, locate("creditcard-payment-sdo")); + + node1.start(); + node2.start(); + + Runnable runner = ((SCAClient)node1).getService(Runnable.class, "TestClient/Runnable"); + runner.run(); + + node1.stop(); + node2.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/build.xml new file mode 100644 index 0000000000..826c542cdb --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/build.xml @@ -0,0 +1,35 @@ +<!--
+ * 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-feed-logger" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <target name="run">
+ <java classname="scatours.FeedLoggerLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/pom.xml new file mode 100644 index 0000000000..fb5a788652 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/pom.xml @@ -0,0 +1,105 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-feed-logger</artifactId>
+ <name>Apache Tuscany SCA Tours Feed Logger Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-atom-abdera</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rss-rome</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.FeedLoggerLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/src/main/java/scatours/FeedLoggerLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/src/main/java/scatours/FeedLoggerLauncher.java new file mode 100644 index 0000000000..4aea24dbfe --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/src/main/java/scatours/FeedLoggerLauncher.java @@ -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.
+ */
+
+package scatours;
+
+import static scatours.launcher.LauncherUtil.locate;
+
+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 scatours.feedlogger.FeedLogger;
+
+public class FeedLoggerLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution feedContribution = locate("feed-logger");
+
+ SCANode node = SCANodeFactory.newInstance().createSCANode("feed-logger.composite", feedContribution);
+ node.start();
+
+ FeedLogger logger = ((SCAClient)node).getService(FeedLogger.class, "FeedLogger");
+ logger.logFeeds(5);
+
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/src/main/java/scatours/feedlogger/FeedLogger.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/src/main/java/scatours/feedlogger/FeedLogger.java new file mode 100644 index 0000000000..8187e34d2c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/feed-logger/src/main/java/scatours/feedlogger/FeedLogger.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 scatours.feedlogger; + +public interface FeedLogger { + + /** + * Captures the configured feeds and logs the feed entries. + * + * @param maxEntriesPerFeed The maximum number of entries to log per feed + */ + public void logFeeds(int maxEntriesPerFeed); +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-domain/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-domain/build.xml new file mode 100644 index 0000000000..36de2a93e4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-domain/build.xml @@ -0,0 +1,38 @@ +<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<project name="scatours-launcher-fullapp-domain" default="run">
+ <import file="../../antdefs.xml"/>
+
+ <!-- The "run" 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 with Tuscany SCA Java version 1.6 and above. -->
+ <target name="run">
+ <java classname="org.apache.tuscany.sca.node.launcher.DomainManagerLauncher"
+ dir="." fork="true" failonerror="true">
+ <classpath>
+ <fileset dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-node-launcher-*.jar"/>
+ </fileset>
+ </classpath>
+ <arg value="../../domainconfig/fullapp/target/classes"/>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-domain/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-domain/pom.xml new file mode 100644 index 0000000000..eb7604506d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-domain/pom.xml @@ -0,0 +1,86 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-fullapp-domain</artifactId>
+ <name>Apache Tuscany SCA Tours Full App Domain Launcher</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-manager</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-xml</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.FullAppDomainLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java new file mode 100644 index 0000000000..324b68ab57 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-domain/src/main/java/scatours/FullAppDomainLauncher.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package scatours; + +import java.io.IOException; + +import org.apache.tuscany.sca.domain.manager.launcher.DomainManagerLauncherBootstrap; +import org.apache.tuscany.sca.node.SCANode; + +/** + * This launcher is only used when running from the binaries directory. + * If the binaries directory was built using the mvn -Pselfcontained command, + * it's important to ensure that no dependencies other than those explicitly + * specified by the launcher jar manifest and its transitive dependencies + * are used. This launcher class must therefore avoid using the Tuscany + * DomainManagerLauncher class, because DomainManagerLauncher builds a + * runtime classpath from (among other things) the TUSCANY_HOME environment + * variable. + */ +public class FullAppDomainLauncher { + + public static void main(String[] args) throws Exception { + String rootDir = "../domainconfig/fullapp"; + DomainManagerLauncherBootstrap bootstrap = new DomainManagerLauncherBootstrap(rootDir); + SCANode node = bootstrap.getNode(); + node.start(); + + System.out.println("Domain manager started - Press enter to shutdown."); + try { + System.in.read(); + } catch (IOException e) { + } + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-nodes/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-nodes/build.xml new file mode 100644 index 0000000000..b147a2087a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-nodes/build.xml @@ -0,0 +1,37 @@ +<!-- + * 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-fullapp-nodes" default="compile"> + <import file="../../antdefs.xml"/> + + <!-- Before invoking the "run" target, the domain manager needs + to be started and running in a different process. --> + <target name="run-domain"> + <ant dir="../fullapp-domain" target="run"/> + </target> + + <target name="run"> + <java classname="scatours.FullAppNodesLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-nodes/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-nodes/pom.xml new file mode 100644 index 0000000000..28f5e93074 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-nodes/pom.xml @@ -0,0 +1,172 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-fullapp-nodes</artifactId> + <name>Apache Tuscany SCA Tours Full Application Nodes Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-widget-runtime-tuscany</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-atom-abdera</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-jsonrpc-js</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-http-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-sca-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ejb-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-ejb</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-bpel-ode</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-spring</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-spring-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>10.3.1.4</version> + <scope>runtime</scope> + </dependency> + + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.FullAppNodesLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-nodes/src/main/java/scatours/FullAppNodesLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-nodes/src/main/java/scatours/FullAppNodesLauncher.java new file mode 100644 index 0000000000..4d6459b749 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp-nodes/src/main/java/scatours/FullAppNodesLauncher.java @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package scatours; + +import java.io.IOException; + +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class FullAppNodesLauncher { + + public static void main(String[] args) throws Exception { + SCANode nodeCreditcard = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/creditcard"); + nodeCreditcard.start(); + + SCANode nodePayment = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/payment"); + nodePayment.start(); + + SCANode nodeShoppingcart = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/shoppingcart"); + nodeShoppingcart.start(); + + SCANode nodeCurrency = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/currency"); + nodeCurrency.start(); + + SCANode nodePackagedtrip = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/packagedtrip"); + nodePackagedtrip.start(); + + SCANode nodeBespoketrip = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/bespoketrip"); + nodeBespoketrip.start(); + + SCANode nodeFrontend = + SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/coordination"); + nodeFrontend.start(); + + SCANode nodeUI = SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/ui"); + nodeUI.start(); + + System.out.println("Point your browser at - http://localhost:8080/scatours/ "); + System.out.println("Nodes started - Press enter to shutdown."); + + try { + System.in.read(); + } catch (IOException e) { + } + + nodeCreditcard.stop(); + nodePayment.stop(); + nodeShoppingcart.stop(); + nodeCurrency.stop(); + nodePackagedtrip.stop(); + nodeBespoketrip.stop(); + nodeFrontend.stop(); + nodeUI.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp/build.xml new file mode 100644 index 0000000000..ab2f62460c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-fullapp" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.FullAppLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp/pom.xml new file mode 100644 index 0000000000..70bef29299 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp/pom.xml @@ -0,0 +1,183 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + <version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-fullapp</artifactId> + <name>Apache Tuscany SCA Tours Full Application Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-widget-runtime-tuscany</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-atom-abdera</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-jsonrpc-js</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-http-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-sca-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ejb-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-ejb</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-bpel-ode</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-spring</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-spring-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>10.3.1.4</version> + <scope>runtime</scope> + </dependency> + + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.FullAppLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp/src/main/java/scatours/FullAppLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp/src/main/java/scatours/FullAppLauncher.java new file mode 100644 index 0000000000..ab1b7d031b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/fullapp/src/main/java/scatours/FullAppLauncher.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package scatours; + +import static scatours.launcher.LauncherUtil.locate; + +import java.io.IOException; + +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class FullAppLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode(null, + locate("common"), + locate("currency"), + locate("hotel"), + locate("flight"), + locate("car"), + locate("trip"), + locate("tripbooking"), + locate("travelcatalog"), + //locate("payment-java-policy"), + locate("payment-spring-policy"), + locate("creditcard-payment-jaxb-policy"), + locate("shoppingcart"), + locate("scatours"), + locate("fullapp-ui"), + locate("fullapp-coordination"), + locate("fullapp-currency"), + locate("fullapp-packagedtrip"), + locate("fullapp-bespoketrip"), + locate("fullapp-shoppingcart")); + + node.start(); + + System.out.println("Point your browser at - http://localhost:8080/scatours/ "); + System.out.println("Node started - Press enter to shutdown."); + + try { + System.in.read(); + } catch (IOException e) { + } + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/help-pages/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/help-pages/build.xml new file mode 100644 index 0000000000..a763c082e0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/help-pages/build.xml @@ -0,0 +1,35 @@ +<!--
+ * 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-help-pages" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <target name="run">
+ <java classname="scatours.HelpPagesLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/help-pages/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/help-pages/pom.xml new file mode 100644 index 0000000000..b26030fb77 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/help-pages/pom.xml @@ -0,0 +1,97 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-help-pages</artifactId>
+ <name>Apache Tuscany SCA Tours Help Pages Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-resource-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-http-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.HelpPagesLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/help-pages/src/main/java/scatours/HelpPagesLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/help-pages/src/main/java/scatours/HelpPagesLauncher.java new file mode 100644 index 0000000000..a72f5c4c54 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/help-pages/src/main/java/scatours/HelpPagesLauncher.java @@ -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.
+ */
+
+package scatours;
+
+import static scatours.launcher.LauncherUtil.locate;
+
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+
+public class HelpPagesLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution helpContribution = locate("help-pages");
+
+ SCANode node = SCANodeFactory.newInstance().createSCANode("help-pages.composite", helpContribution);
+ node.start();
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.out.println();
+ System.out.println("To view the help pages, use your Web browser to view:");
+ System.out.println(" http://localhost:8085/help/index.html");
+ System.out.println();
+ System.in.read();
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/build.xml new file mode 100644 index 0000000000..8db09fe972 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/build.xml @@ -0,0 +1,35 @@ +<!--
+ * 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-interaction" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <target name="run">
+ <java classname="scatours.InteractionLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/pom.xml new file mode 100644 index 0000000000..7e15913e53 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/pom.xml @@ -0,0 +1,104 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-interaction</artifactId>
+ <name>Apache Tuscany SCA Tours Interaction Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.InteractionLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/src/main/java/scatours/InteractionLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/src/main/java/scatours/InteractionLauncher.java new file mode 100644 index 0000000000..b3e0e52f2e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/src/main/java/scatours/InteractionLauncher.java @@ -0,0 +1,70 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+
+public class InteractionLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCANode node1 =
+ SCANodeFactory.newInstance().createSCANode("client.composite",
+ locate("common"),
+ locate("currency"),
+ locate("calendar"),
+ locate("shoppingcart"),
+ locate("interaction-client"));
+
+ SCANode node2 =
+ SCANodeFactory.newInstance().createSCANode("service.composite",
+ locate("common"),
+ locate("hotel"),
+ locate("flight"),
+ locate("interaction-service-remote"));
+
+ node2.start();
+ node1.start();
+
+ Runnable localInteraction = ((SCAClient)node1).getService(Runnable.class, "InteractionLocalClient/Runnable");
+ localInteraction.run();
+
+ Runnable remoteInteraction = ((SCAClient)node1).getService(Runnable.class, "InteractionRemoteClient/Runnable");
+ remoteInteraction.run();
+
+ Runnable requestResponseInteraction =
+ ((SCAClient)node1).getService(Runnable.class, "InteractionRequestResponseClient/Runnable");
+ requestResponseInteraction.run();
+
+ Runnable onewayCallbackInteraction =
+ ((SCAClient)node1).getService(Runnable.class, "InteractionOneWayCallbackClient/Runnable");
+ onewayCallbackInteraction.run();
+
+ Runnable conversationalInteraction =
+ ((SCAClient)node1).getService(Runnable.class, "InteractionConversationClient/Runnable");
+ conversationalInteraction.run();
+
+ node1.stop();
+ node2.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/src/test/java/scatours/InteractionTestCase.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/src/test/java/scatours/InteractionTestCase.java new file mode 100644 index 0000000000..c64e5d1e5b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/interaction/src/test/java/scatours/InteractionTestCase.java @@ -0,0 +1,42 @@ +/*
+ * 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.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests the launcher
+ */
+public class InteractionTestCase {
+
+ @Before
+ public void startServer() throws Exception {
+ }
+
+ @Test
+ public void testLauncher() throws Exception {
+ InteractionLauncher.main(null);
+ }
+
+ @After
+ public void stopServer() throws Exception {
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-client/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-client/build.xml new file mode 100644 index 0000000000..84b3ade200 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-client/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-launcher-introducing-client" default="compile">
+ <import file="../../antdefs.xml"/>
+
+ <!-- Before invoking the "run" target, the domain manager and the
+ introducing-trips and introducing-tours nodes need to be started
+ and running in different processes. -->
+ <target name="run-domain">
+ <ant dir="../introducing-domain" target="run"/>
+ </target>
+ <target name="run-trips">
+ <ant dir="../introducing-trips" target="run"/>
+ </target>
+ <target name="run-tours">
+ <ant dir="../introducing-tours" target="run"/>
+ </target>
+
+ <target name="run">
+ <java classname="scatours.IntroducingClientLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-client/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-client/pom.xml new file mode 100644 index 0000000000..7385505063 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-client/pom.xml @@ -0,0 +1,90 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-introducing-client</artifactId>
+ <name>Apache Tuscany SCA Tours Introducing Client Launcher</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-sca-axis2</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- The folowing dependency has been added as a workaround for issue
+ TUSCANY-3540 so that the travel sample can run on Tuscany SCA 1.6.
+ When a Tuscany SCA release with a fix for TUSCANY-3540 is available,
+ this unnecessary dependency can be removed. -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.IntroducingClientLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-client/src/main/java/scatours/IntroducingClientLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-client/src/main/java/scatours/IntroducingClientLauncher.java new file mode 100644 index 0000000000..f261ef6e27 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-client/src/main/java/scatours/IntroducingClientLauncher.java @@ -0,0 +1,38 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package scatours;
+
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+
+public class IntroducingClientLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/ClientNode");
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable");
+ client.run();
+
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-domain/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-domain/build.xml new file mode 100644 index 0000000000..9d8c28b8e1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-domain/build.xml @@ -0,0 +1,38 @@ +<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<project name="scatours-launcher-introducing-domain" default="run">
+ <import file="../../antdefs.xml"/>
+
+ <!-- The "run" 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 with Tuscany SCA Java version 1.6 and above. -->
+ <target name="run">
+ <java classname="org.apache.tuscany.sca.node.launcher.DomainManagerLauncher"
+ dir="." fork="true" failonerror="true">
+ <classpath>
+ <fileset dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-node-launcher-*.jar"/>
+ </fileset>
+ </classpath>
+ <arg value="../../domainconfig/introducing/target/classes"/>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-domain/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-domain/pom.xml new file mode 100644 index 0000000000..43d256e212 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-domain/pom.xml @@ -0,0 +1,86 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-introducing-domain</artifactId>
+ <name>Apache Tuscany SCA Tours Introducing Domain Launcher</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-manager</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-xml</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.IntroducingDomainLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-domain/src/main/java/scatours/IntroducingDomainLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-domain/src/main/java/scatours/IntroducingDomainLauncher.java new file mode 100644 index 0000000000..1b47ef92bd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-domain/src/main/java/scatours/IntroducingDomainLauncher.java @@ -0,0 +1,53 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package scatours;
+
+import java.io.IOException;
+
+import org.apache.tuscany.sca.domain.manager.launcher.DomainManagerLauncherBootstrap;
+import org.apache.tuscany.sca.node.SCANode;
+
+/**
+ * This launcher is only used when running from the binaries directory.
+ * If the binaries directory was built using the mvn -Pselfcontained command,
+ * it's important to ensure that no dependencies other than those explicitly
+ * specified by the launcher jar manifest and its transitive dependencies
+ * are used. This launcher class must therefore avoid using the Tuscany
+ * DomainManagerLauncher class, because DomainManagerLauncher builds a
+ * runtime classpath from (among other things) the TUSCANY_HOME environment
+ * variable.
+ */
+public class IntroducingDomainLauncher {
+
+ public static void main(String[] args) throws Exception {
+ String rootDir = "../domainconfig/introducing";
+ DomainManagerLauncherBootstrap bootstrap = new DomainManagerLauncherBootstrap(rootDir);
+ SCANode node = bootstrap.getNode();
+ node.start();
+
+ System.out.println("Domain manager started - Press enter to shutdown.");
+ try {
+ System.in.read();
+ } catch (IOException e) {
+ }
+
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-tours/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-tours/build.xml new file mode 100644 index 0000000000..1713b85e03 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-tours/build.xml @@ -0,0 +1,34 @@ +<!--
+ * 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-introducing-tours" default="run">
+ <import file="../../antdefs.xml"/>
+
+ <target name="run">
+ <java classname="org.apache.tuscany.sca.node.launcher.NodeLauncher"
+ fork="true" failonerror="true">
+ <arg value="http://localhost:9990/node-config/ToursNode"/>
+ <classpath>
+ <fileset dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-node-launcher-*.jar"/>
+ </fileset>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-tours/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-tours/pom.xml new file mode 100644 index 0000000000..5970149bc9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-tours/pom.xml @@ -0,0 +1,86 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-introducing-tours</artifactId>
+ <name>Apache Tuscany SCA Tours Introducing Tours Launcher</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-sca-axis2</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.IntroducingToursLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-tours/src/main/java/scatours/IntroducingToursLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-tours/src/main/java/scatours/IntroducingToursLauncher.java new file mode 100644 index 0000000000..c99bf58e07 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-tours/src/main/java/scatours/IntroducingToursLauncher.java @@ -0,0 +1,51 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package scatours;
+
+import java.io.IOException;
+
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+
+/**
+ * This launcher is only used when running from the binaries directory.
+ * If the binaries directory was built using the mvn -Pselfcontained command,
+ * it's important to ensure that no dependencies other than those explicitly
+ * specified by the launcher jar manifest and its transitive dependencies
+ * are used. This launcher class must therefore avoid using the Tuscany
+ * NodeLauncher class, because NodeLauncher builds a runtime classpath from
+ * (among other things) the TUSCANY_HOME environment variable.
+ */
+public class IntroducingToursLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/ToursNode");
+ node.start();
+
+ System.out.println("Node started - Press enter to shutdown.");
+ try {
+ System.in.read();
+ } catch (IOException e) {
+ }
+
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-trips/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-trips/build.xml new file mode 100644 index 0000000000..4059606a08 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-trips/build.xml @@ -0,0 +1,34 @@ +<!--
+ * 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-introducing-trips" default="run">
+ <import file="../../antdefs.xml"/>
+
+ <target name="run">
+ <java classname="org.apache.tuscany.sca.node.launcher.NodeLauncher"
+ fork="true" failonerror="true">
+ <arg value="http://localhost:9990/node-config/TripsNode"/>
+ <classpath>
+ <fileset dir="${env.TUSCANY_HOME}/modules">
+ <include name="tuscany-node-launcher-*.jar"/>
+ </fileset>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-trips/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-trips/pom.xml new file mode 100644 index 0000000000..ec5da820e7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-trips/pom.xml @@ -0,0 +1,86 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-introducing-trips</artifactId>
+ <name>Apache Tuscany SCA Tours Introducing Trips Launcher</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-sca-axis2</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.IntroducingTripsLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-trips/src/main/java/scatours/IntroducingTripsLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-trips/src/main/java/scatours/IntroducingTripsLauncher.java new file mode 100644 index 0000000000..10dfc242e1 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing-trips/src/main/java/scatours/IntroducingTripsLauncher.java @@ -0,0 +1,51 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package scatours;
+
+import java.io.IOException;
+
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+
+/**
+ * This launcher is only used when running from the binaries directory.
+ * If the binaries directory was built using the mvn -Pselfcontained command,
+ * it's important to ensure that no dependencies other than those explicitly
+ * specified by the launcher jar manifest and its transitive dependencies
+ * are used. This launcher class must therefore avoid using the Tuscany
+ * NodeLauncher class, because NodeLauncher builds a runtime classpath from
+ * (among other things) the TUSCANY_HOME environment variable.
+ */
+public class IntroducingTripsLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANodeFromURL("http://localhost:9990/node-config/TripsNode");
+ node.start();
+
+ System.out.println("Node started - Press enter to shutdown.");
+ try {
+ System.in.read();
+ } catch (IOException e) {
+ }
+
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/build.xml new file mode 100644 index 0000000000..217679604d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/build.xml @@ -0,0 +1,35 @@ +<!--
+ * 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-introducing" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <target name="run">
+ <java classname="scatours.IntroducingLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/pom.xml new file mode 100644 index 0000000000..98c8627d6c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/pom.xml @@ -0,0 +1,90 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-introducing</artifactId>
+ <name>Apache Tuscany SCA Tours Introducing Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.IntroducingLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/src/main/java/scatours/IntroducingLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/src/main/java/scatours/IntroducingLauncher.java new file mode 100644 index 0000000000..4ad19762d9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/src/main/java/scatours/IntroducingLauncher.java @@ -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. + */ + +package scatours; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class IntroducingLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = + SCANodeFactory.newInstance().createSCANode(null, + locate("introducing-tours"), + locate("introducing-trips"), + locate("introducing-client")); + + node.start(); + + Runnable proxy = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable"); + proxy.run(); + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/src/test/java/scatours/IntroducingTestCase.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/src/test/java/scatours/IntroducingTestCase.java new file mode 100644 index 0000000000..573d2e76bd --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/introducing/src/test/java/scatours/IntroducingTestCase.java @@ -0,0 +1,62 @@ +/*
+ * 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;
+
+/**
+ * Test case to run the test code in the introducing-client contribution
+ * that tests components and services in the introducing-tours contribution
+ * and the introducing-trips contribution.
+ */
+public class IntroducingTestCase {
+
+ private SCANode node;
+
+ @Before
+ public void startServer() throws Exception {
+ node =
+ SCANodeFactory.newInstance()
+ .createSCANode(null,
+ new SCAContribution("introducing-tours",
+ "../../contributions/introducing-tours/target/classes"),
+ new SCAContribution("introducing-trips",
+ "../../contributions/introducing-trips/target/classes"),
+ new SCAContribution("introducing-client",
+ "../../contributions/introducing-client/target/classes"));
+ node.start();
+ }
+
+ @Test
+ public void testClient() throws Exception {
+ Runnable proxy = ((SCAClient)node).getService(Runnable.class, "TestClient/Runnable");
+ proxy.run();
+ }
+
+ @After
+ public void stopServer() throws Exception {
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/build.xml new file mode 100644 index 0000000000..b7aead4d1c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/build.xml @@ -0,0 +1,31 @@ +<!--
+ * 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-jumpstart" default="compile">
+ <import file="../../antdefs.xml"/>
+
+ <target name="run">
+ <java classname="scatours.JumpstartLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/pom.xml new file mode 100644 index 0000000000..c5f50cb8df --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/pom.xml @@ -0,0 +1,79 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-jumpstart</artifactId>
+ <name>Apache Tuscany SCA Tours Jump Start Launcher</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.JumpstartLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/src/main/java/scatours/JumpstartLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/src/main/java/scatours/JumpstartLauncher.java new file mode 100644 index 0000000000..e2f0f9da4b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/src/main/java/scatours/JumpstartLauncher.java @@ -0,0 +1,43 @@ +/*
+ * 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;
+
+public class JumpstartLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution gvtContribution = new SCAContribution("introducing-trips",
+ "../../contributions/introducing-trips/target/classes");
+
+ SCANode node = SCANodeFactory.newInstance().createSCANode("trips.composite", gvtContribution);
+
+ node.start();
+
+ Trips tripProvider = ((SCAClient)node).getService(Trips.class, "TripProvider/Trips");
+
+ System.out.println("Trip boooking code = " + tripProvider.checkAvailability("FS1APR4", 1));
+
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/src/main/java/scatours/Trips.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/src/main/java/scatours/Trips.java new file mode 100644 index 0000000000..a7abf8e08d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/src/main/java/scatours/Trips.java @@ -0,0 +1,26 @@ +/*
+ * 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.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface Trips {
+ String checkAvailability(String trip, int people);
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/src/test/java/scatours/JumpstartTestCase.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/src/test/java/scatours/JumpstartTestCase.java new file mode 100644 index 0000000000..4da7c54917 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/jumpstart/src/test/java/scatours/JumpstartTestCase.java @@ -0,0 +1,56 @@ +/*
+ * 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 the Jump Start scenario
+ */
+public class JumpstartTestCase {
+
+ private SCANode node;
+
+ @Before
+ public void startServer() throws Exception {
+ node =
+ SCANodeFactory.newInstance()
+ .createSCANode("trips.composite",
+ new SCAContribution("introducing-trips",
+ "../../contributions/introducing-trips/target/classes"));
+ node.start();
+ }
+
+ @Test
+ public void testClient() throws Exception {
+ Trips tripProvider = ((SCAClient)node).getService(Trips.class, "TripProvider/Trips");
+ System.out.println("Trip boooking code = " + tripProvider.checkAvailability("FS1APR4", 2));
+ }
+
+ @After
+ public void stopServer() throws Exception {
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/build.xml new file mode 100644 index 0000000000..4c2524fdd0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/build.xml @@ -0,0 +1,41 @@ +<!--
+ * 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-notification-corba" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <!-- Before invoking the "run" target, the CORBA SMS Gateway service
+ needs to be started and running in a different process. -->
+ <target name="run-smsgateway">
+ <ant dir="../../services/smsgateway-corba" target="run"/>
+ </target>
+
+ <target name="run">
+ <java classname="scatours.NotificationCORBALauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/pom.xml new file mode 100644 index 0000000000..077e5e724f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/pom.xml @@ -0,0 +1,97 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-notification-corba</artifactId>
+ <name>Apache Tuscany SCA Tours Notification CORBA Service Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-corba-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-corba-jse-tns</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.NotificationCORBALauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/src/main/java/scatours/NotificationCORBALauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/src/main/java/scatours/NotificationCORBALauncher.java new file mode 100644 index 0000000000..44b94b3a59 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/src/main/java/scatours/NotificationCORBALauncher.java @@ -0,0 +1,54 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+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 scatours.notification.Notification;
+
+public class NotificationCORBALauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution notificationContribution = locate("notification");
+ SCAContribution notificationCORBAContribution = locate("notification-corba");
+
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("notification-corba.composite",
+ notificationContribution,
+ notificationCORBAContribution);
+ node.start();
+
+ System.out.println("Quick notification test");
+ Notification notification = ((SCAClient)node).getService(Notification.class, "Notification");
+ String accountID = "1234";
+ String subject = "Holiday payment taken";
+ String message = "Payment of £102.37 accepted...";
+ notification.notify(accountID, subject, message);
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.in.read();
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/src/main/java/scatours/notification/Notification.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/src/main/java/scatours/notification/Notification.java new file mode 100644 index 0000000000..020e1e40db --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-corba/src/main/java/scatours/notification/Notification.java @@ -0,0 +1,26 @@ +/* + * 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.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/build.xml new file mode 100644 index 0000000000..ec1416635c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/build.xml @@ -0,0 +1,42 @@ +<!--
+ * 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-notification-ejb" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <!-- 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" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ <fileset dir="${env.OPENEJB_HOME}/lib"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/pom.xml new file mode 100644 index 0000000000..1dd95cf3e5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/pom.xml @@ -0,0 +1,97 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-notification-ejb</artifactId>
+ <name>Apache Tuscany SCA Tours Notification EJB Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ejb</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ejb-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar ../util/scatours-util-openejb-runtime.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.NotificationEJBLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/src/main/java/scatours/NotificationEJBLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/src/main/java/scatours/NotificationEJBLauncher.java new file mode 100644 index 0000000000..2d843e9ff9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/src/main/java/scatours/NotificationEJBLauncher.java @@ -0,0 +1,59 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+import javax.naming.Context;
+
+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 scatours.notification.Notification;
+
+public class NotificationEJBLauncher {
+
+ public static void main(String[] args) throws Exception {
+ System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+ System.setProperty(Context.PROVIDER_URL, "ejbd://localhost:4201");
+
+ SCAContribution notificationContribution = locate("notification");
+ SCAContribution notificationEJBContribution = locate("notification-ejb");
+
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("notification-ejb.composite",
+ notificationContribution,
+ notificationEJBContribution);
+ node.start();
+
+ System.out.println("Quick notification test");
+ Notification notification = ((SCAClient)node).getService(Notification.class, "Notification");
+ String accountID = "1234";
+ String subject = "Holiday payment taken";
+ String message = "Payment of £102.37 accepted...";
+ notification.notify(accountID, subject, message);
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.in.read();
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/src/main/java/scatours/notification/Notification.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/src/main/java/scatours/notification/Notification.java new file mode 100644 index 0000000000..020e1e40db --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ejb/src/main/java/scatours/notification/Notification.java @@ -0,0 +1,26 @@ +/* + * 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.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/build.xml new file mode 100644 index 0000000000..e7129ddc61 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/build.xml @@ -0,0 +1,41 @@ +<!--
+ * 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-notification-jms" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <!-- Before invoking the "run" target, the JMS implementation of the
+ SMS gateway needs to be started and running in a different process. -->
+ <target name="run-smsgateway">
+ <ant dir="../../services/smsgateway-jms" target="run"/>
+ </target>
+
+ <target name="run">
+ <java classname="scatours.NotificationJMSLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/pom.xml new file mode 100644 index 0000000000..3b20798e40 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/pom.xml @@ -0,0 +1,103 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-notification-jms</artifactId>
+ <name>Apache Tuscany SCA Tours Notification JMS Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jms-asf</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-all</artifactId>
+ <version>5.2.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-web-demo</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.NotificationJMSLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/src/main/java/scatours/NotificationJMSLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/src/main/java/scatours/NotificationJMSLauncher.java new file mode 100644 index 0000000000..c2ffda0725 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/src/main/java/scatours/NotificationJMSLauncher.java @@ -0,0 +1,56 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+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 scatours.notification.Notification;
+
+public class NotificationJMSLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution notificationContribution = locate("notification");
+ SCAContribution notificationJMSContribution = locate("notification-jms");
+
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("notification-jms.composite",
+ notificationContribution,
+ notificationJMSContribution);
+
+ try {
+ node.start();
+
+ System.out.println("Quick notification test");
+ Notification notification = ((SCAClient)node).getService(Notification.class, "Notification");
+ String accountID = "1234";
+ String subject = "Holiday payment taken";
+ String message = "Payment of £102.37 accepted...";
+ notification.notify(accountID, subject, message);
+ System.out.println("Notification sent");
+ } finally {
+ node.stop();
+ }
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/src/main/java/scatours/notification/Notification.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/src/main/java/scatours/notification/Notification.java new file mode 100644 index 0000000000..020e1e40db --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-jms/src/main/java/scatours/notification/Notification.java @@ -0,0 +1,26 @@ +/* + * 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.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/build.xml new file mode 100644 index 0000000000..a4f7b17d01 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/build.xml @@ -0,0 +1,41 @@ +<!--
+ * 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-notification-rmi" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <!-- 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" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/pom.xml new file mode 100644 index 0000000000..69590fa45e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/pom.xml @@ -0,0 +1,97 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-notification-rmi</artifactId>
+ <name>Apache Tuscany SCA Tours Notification RMI Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.NotificationRMILauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/src/main/java/com/tuscanyscatours/smsgateway/SMSGateway.java new file mode 100644 index 0000000000..4ce528fd23 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-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/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/src/main/java/scatours/NotificationRMILauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/src/main/java/scatours/NotificationRMILauncher.java new file mode 100644 index 0000000000..2904349a49 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/src/main/java/scatours/NotificationRMILauncher.java @@ -0,0 +1,54 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+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 scatours.notification.Notification;
+
+public class NotificationRMILauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution notificationContribution = locate("notification");
+ SCAContribution notificationRMIContribution = locate("notification-rmi");
+
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("notification-rmi.composite",
+ notificationContribution,
+ notificationRMIContribution);
+ node.start();
+
+ System.out.println("Quick notification test");
+ Notification notification = ((SCAClient)node).getService(Notification.class, "Notification");
+ String accountID = "1234";
+ String subject = "Holiday payment taken";
+ String message = "Payment of £102.37 accepted...";
+ notification.notify(accountID, subject, message);
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.in.read();
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/src/main/java/scatours/notification/Notification.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/src/main/java/scatours/notification/Notification.java new file mode 100644 index 0000000000..020e1e40db --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-rmi/src/main/java/scatours/notification/Notification.java @@ -0,0 +1,26 @@ +/* + * 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.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/build.xml new file mode 100644 index 0000000000..a6a3ac5ef0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/build.xml @@ -0,0 +1,41 @@ +<!--
+ * 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-notification-ws" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <!-- Before invoking the "run" target, the JAX-WS 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-jaxws" target="run"/>
+ </target>
+
+ <target name="run">
+ <java classname="scatours.NotificationWSLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/pom.xml new file mode 100644 index 0000000000..c5dd336d6b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/pom.xml @@ -0,0 +1,97 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-notification-ws</artifactId>
+ <name>Apache Tuscany SCA Tours Notification Web Service Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.NotificationWSLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java new file mode 100644 index 0000000000..fbdb1500f5 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/src/main/java/scatours/NotificationWSLauncher.java @@ -0,0 +1,54 @@ +/*
+ * 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 static scatours.launcher.LauncherUtil.locate;
+
+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 scatours.notification.Notification;
+
+public class NotificationWSLauncher {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution notificationContribution = locate("notification");
+ SCAContribution notificationWSContribution = locate("notification-ws");
+
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("notification-ws.composite",
+ notificationContribution,
+ notificationWSContribution);
+ node.start();
+
+ System.out.println("Quick notification test");
+ Notification notification = ((SCAClient)node).getService(Notification.class, "Notification");
+ String accountID = "1234";
+ String subject = "Holiday payment taken";
+ String message = "Payment of £102.37 accepted...";
+ notification.notify(accountID, subject, message);
+
+ System.out.println("Node started - Press enter to shutdown.");
+ System.in.read();
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/src/main/java/scatours/notification/Notification.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/src/main/java/scatours/notification/Notification.java new file mode 100644 index 0000000000..020e1e40db --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/notification-ws/src/main/java/scatours/notification/Notification.java @@ -0,0 +1,26 @@ +/* + * 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.notification; + +public interface Notification { + + boolean notify(String accountID, String subject, String message); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/build.xml new file mode 100644 index 0000000000..f9d839c17e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/build.xml @@ -0,0 +1,41 @@ +<!-- + * 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-payment-bpel" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <unzip dest="target/ode"> + <fileset dir="${env.TUSCANY_HOME}/lib"> + <include name="ode-dao-jpa-ojpa-derby-*.zip"/> + </fileset> + </unzip> + <java classname="scatours.payment.PaymentLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <pathelement location="target/ode"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/pom.xml new file mode 100644 index 0000000000..811bb6a9ed --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/pom.xml @@ -0,0 +1,140 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-payment-bpel</artifactId> + <name>Apache Tuscany SCA Tours Payment BPEL Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>javax.xml.ws</groupId> + <artifactId>jaxws-api</artifactId> + <version>2.1</version> + <exclusions> + <exclusion> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-bpel-ode</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <!-- Replace commons-logging-1.0.4 brought in by tuscany-implementation-bpel-ode --> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1.1</version> + <exclusions> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + <exclusion> + <groupId>avalon-framework</groupId> + <artifactId>avalon-framework</artifactId> + </exclusion> + </exclusions> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar ../ode/</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.payment.PaymentLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java new file mode 100644 index 0000000000..e5f3ef3cad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberResponseType", propOrder = { + "status" +}) +public class MakePaymentMemberResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java new file mode 100644 index 0000000000..ca94d86628 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java @@ -0,0 +1,82 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="CustomerId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberType", propOrder = { + "customerId", + "amount" +}) +public class MakePaymentMemberType { + + @XmlElement(name = "CustomerId", required = true) + protected String customerId; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the customerId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustomerId() { + return customerId; + } + + /** + * Sets the value of the customerId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustomerId(String value) { + this.customerId = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java new file mode 100644 index 0000000000..b069b2ba94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.payment package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MakePaymentMember_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMember"); + private final static QName _MakePaymentMemberResponse_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMemberResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.payment + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link MakePaymentMemberResponseType } + * + */ + public MakePaymentMemberResponseType createMakePaymentMemberResponseType() { + return new MakePaymentMemberResponseType(); + } + + /** + * Create an instance of {@link MakePaymentMemberType } + * + */ + public MakePaymentMemberType createMakePaymentMemberType() { + return new MakePaymentMemberType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMember") + public JAXBElement<MakePaymentMemberType> createMakePaymentMember(MakePaymentMemberType value) { + return new JAXBElement<MakePaymentMemberType>(_MakePaymentMember_QNAME, MakePaymentMemberType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMemberResponse") + public JAXBElement<MakePaymentMemberResponseType> createMakePaymentMemberResponse(MakePaymentMemberResponseType value) { + return new JAXBElement<MakePaymentMemberResponseType>(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/Payment.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/Payment.java new file mode 100644 index 0000000000..bbbd03d89a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/Payment.java @@ -0,0 +1,43 @@ + +package com.tuscanyscatours.payment; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "Payment", targetNamespace = "http://www.tuscanyscatours.com/Payment/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Payment { + + + /** + * + * @param amount + * @param customerId + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/Payment/makePayment") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "makePaymentMember", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberType") + @ResponseWrapper(localName = "makePaymentMemberResponse", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberResponseType") + public String makePaymentMember( + @WebParam(name = "CustomerId", targetNamespace = "") + String customerId, + @WebParam(name = "Amount", targetNamespace = "") + float amount); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/PaymentService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/PaymentService.java new file mode 100644 index 0000000000..a430175976 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/PaymentService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "PaymentService", targetNamespace = "http://www.tuscanyscatours.com/Payment/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl") +public class PaymentService + extends Service +{ + + private final static URL PAYMENTSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.payment.PaymentService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.payment.PaymentService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + PAYMENTSERVICE_WSDL_LOCATION = url; + } + + public PaymentService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public PaymentService() { + super(PAYMENTSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/Payment/", "PaymentService")); + } + + /** + * + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/package-info.java new file mode 100644 index 0000000000..acd208f5c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/com/tuscanyscatours/payment/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/Payment/") +package com.tuscanyscatours.payment; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..45df91a5e9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-bpel/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,53 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-bpel-process"), + locate("payment-bpel"), + locate("creditcard-payment-jaxb"), + locate("emailgateway")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment/paymentPartnerLink"); + + System.out.println("Payment BPEL test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + + node.stop(); + + // The following line is a workaround for TUSCANY-3475 when running + // on Tuscany SCA 1.6 (the JVM waits for 60 seconds before exiting). + System.exit(0); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/build.xml new file mode 100644 index 0000000000..17bd0943a0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-payment-groovy" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.payment.PaymentLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/pom.xml new file mode 100644 index 0000000000..b46c58001c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/pom.xml @@ -0,0 +1,122 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-payment-groovy</artifactId> + <name>Apache Tuscany SCA Tours Payment Groovy Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>javax.xml.ws</groupId> + <artifactId>jaxws-api</artifactId> + <version>2.1</version> + <exclusions> + <exclusion> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-script</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.payment.PaymentLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java new file mode 100644 index 0000000000..0e4e9726de --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java @@ -0,0 +1,40 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "EmailGateway", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface EmailGateway { + + + /** + * + * @param email + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/EmailGateway/sendEmail") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "sendEmail", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/", className = "com.tuscanyscatours.emailgateway.SendEmailType") + @ResponseWrapper(localName = "sendEmailResponse", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/", className = "com.tuscanyscatours.emailgateway.SendEmailResponseType") + public String sendEmail( + @WebParam(name = "Email", targetNamespace = "") + EmailType email); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGatewayService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGatewayService.java new file mode 100644 index 0000000000..8f87855dd9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailGatewayService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.emailgateway; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "EmailGatewayService", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl") +public class EmailGatewayService + extends Service +{ + + private final static URL EMAILGATEWAYSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.emailgateway.EmailGatewayService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.emailgateway.EmailGatewayService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + EMAILGATEWAYSERVICE_WSDL_LOCATION = url; + } + + public EmailGatewayService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public EmailGatewayService() { + super(EMAILGATEWAYSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/EmailGateway/", "EmailGatewayService")); + } + + /** + * + * @return + * returns EmailGateway + */ + @WebEndpoint(name = "EmailGatewayPort") + public EmailGateway getEmailGatewayPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/EmailGateway/", "EmailGatewayPort"), EmailGateway.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns EmailGateway + */ + @WebEndpoint(name = "EmailGatewayPort") + public EmailGateway getEmailGatewayPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/EmailGateway/", "EmailGatewayPort"), EmailGateway.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailType.java new file mode 100644 index 0000000000..25935d2303 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/EmailType.java @@ -0,0 +1,118 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for EmailType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="EmailType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="To" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Title" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Body" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "EmailType", propOrder = { + "to", + "title", + "body" +}) +public class EmailType { + + @XmlElement(name = "To", required = true) + protected String to; + @XmlElement(name = "Title", required = true) + protected String title; + @XmlElement(name = "Body", required = true) + protected String body; + + /** + * Gets the value of the to property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTo() { + return to; + } + + /** + * Sets the value of the to property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTo(String value) { + this.to = value; + } + + /** + * Gets the value of the title property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTitle() { + return title; + } + + /** + * Sets the value of the title property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTitle(String value) { + this.title = value; + } + + /** + * Gets the value of the body property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBody() { + return body; + } + + /** + * Sets the value of the body property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBody(String value) { + this.body = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/ObjectFactory.java new file mode 100644 index 0000000000..f414bb3eb3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/ObjectFactory.java @@ -0,0 +1,79 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.emailgateway package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _SendEmailResponse_QNAME = new QName("http://www.tuscanyscatours.com/EmailGateway/", "sendEmailResponse"); + private final static QName _SendEmail_QNAME = new QName("http://www.tuscanyscatours.com/EmailGateway/", "sendEmail"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.emailgateway + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link SendEmailType } + * + */ + public SendEmailType createSendEmailType() { + return new SendEmailType(); + } + + /** + * Create an instance of {@link EmailType } + * + */ + public EmailType createEmailType() { + return new EmailType(); + } + + /** + * Create an instance of {@link SendEmailResponseType } + * + */ + public SendEmailResponseType createSendEmailResponseType() { + return new SendEmailResponseType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SendEmailResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/EmailGateway/", name = "sendEmailResponse") + public JAXBElement<SendEmailResponseType> createSendEmailResponse(SendEmailResponseType value) { + return new JAXBElement<SendEmailResponseType>(_SendEmailResponse_QNAME, SendEmailResponseType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SendEmailType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/EmailGateway/", name = "sendEmail") + public JAXBElement<SendEmailType> createSendEmail(SendEmailType value) { + return new JAXBElement<SendEmailType>(_SendEmail_QNAME, SendEmailType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailResponseType.java new file mode 100644 index 0000000000..6d366b7554 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for SendEmailResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="SendEmailResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SendEmailResponseType", propOrder = { + "status" +}) +public class SendEmailResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailType.java new file mode 100644 index 0000000000..cc8e15366c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/SendEmailType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for SendEmailType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="SendEmailType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Email" type="{http://www.tuscanyscatours.com/EmailGateway/}EmailType"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SendEmailType", propOrder = { + "email" +}) +public class SendEmailType { + + @XmlElement(name = "Email", required = true) + protected EmailType email; + + /** + * Gets the value of the email property. + * + * @return + * possible object is + * {@link EmailType } + * + */ + public EmailType getEmail() { + return email; + } + + /** + * Sets the value of the email property. + * + * @param value + * allowed object is + * {@link EmailType } + * + */ + public void setEmail(EmailType value) { + this.email = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/package-info.java new file mode 100644 index 0000000000..2c2d603ada --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/emailgateway/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/EmailGateway/") +package com.tuscanyscatours.emailgateway; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java new file mode 100644 index 0000000000..e5f3ef3cad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberResponseType", propOrder = { + "status" +}) +public class MakePaymentMemberResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java new file mode 100644 index 0000000000..ca94d86628 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java @@ -0,0 +1,82 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="CustomerId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberType", propOrder = { + "customerId", + "amount" +}) +public class MakePaymentMemberType { + + @XmlElement(name = "CustomerId", required = true) + protected String customerId; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the customerId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustomerId() { + return customerId; + } + + /** + * Sets the value of the customerId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustomerId(String value) { + this.customerId = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java new file mode 100644 index 0000000000..b069b2ba94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.payment package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MakePaymentMember_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMember"); + private final static QName _MakePaymentMemberResponse_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMemberResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.payment + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link MakePaymentMemberResponseType } + * + */ + public MakePaymentMemberResponseType createMakePaymentMemberResponseType() { + return new MakePaymentMemberResponseType(); + } + + /** + * Create an instance of {@link MakePaymentMemberType } + * + */ + public MakePaymentMemberType createMakePaymentMemberType() { + return new MakePaymentMemberType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMember") + public JAXBElement<MakePaymentMemberType> createMakePaymentMember(MakePaymentMemberType value) { + return new JAXBElement<MakePaymentMemberType>(_MakePaymentMember_QNAME, MakePaymentMemberType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMemberResponse") + public JAXBElement<MakePaymentMemberResponseType> createMakePaymentMemberResponse(MakePaymentMemberResponseType value) { + return new JAXBElement<MakePaymentMemberResponseType>(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/Payment.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/Payment.java new file mode 100644 index 0000000000..bbbd03d89a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/Payment.java @@ -0,0 +1,43 @@ + +package com.tuscanyscatours.payment; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "Payment", targetNamespace = "http://www.tuscanyscatours.com/Payment/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Payment { + + + /** + * + * @param amount + * @param customerId + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/Payment/makePayment") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "makePaymentMember", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberType") + @ResponseWrapper(localName = "makePaymentMemberResponse", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberResponseType") + public String makePaymentMember( + @WebParam(name = "CustomerId", targetNamespace = "") + String customerId, + @WebParam(name = "Amount", targetNamespace = "") + float amount); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/PaymentService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/PaymentService.java new file mode 100644 index 0000000000..a430175976 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/PaymentService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "PaymentService", targetNamespace = "http://www.tuscanyscatours.com/Payment/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl") +public class PaymentService + extends Service +{ + + private final static URL PAYMENTSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.payment.PaymentService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.payment.PaymentService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + PAYMENTSERVICE_WSDL_LOCATION = url; + } + + public PaymentService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public PaymentService() { + super(PAYMENTSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/Payment/", "PaymentService")); + } + + /** + * + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/package-info.java new file mode 100644 index 0000000000..acd208f5c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/com/tuscanyscatours/payment/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/Payment/") +package com.tuscanyscatours.payment; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..8dbf39b514 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-groovy/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,47 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-groovy"), + locate("creditcard-payment-jaxb"), + locate("emailgateway")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("Payment Groovy test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/build.xml new file mode 100644 index 0000000000..725a92e516 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-payment-java-callback" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.payment.PaymentLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/pom.xml new file mode 100644 index 0000000000..d4ea82f62c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/pom.xml @@ -0,0 +1,115 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-payment-java-callback</artifactId> + <name>Apache Tuscany SCA Tours Payment Java Callback Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>javax.xml.ws</groupId> + <artifactId>jaxws-api</artifactId> + <version>2.1</version> + <exclusions> + <exclusion> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.payment.PaymentLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java new file mode 100644 index 0000000000..e5f3ef3cad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberResponseType", propOrder = { + "status" +}) +public class MakePaymentMemberResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java new file mode 100644 index 0000000000..ca94d86628 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java @@ -0,0 +1,82 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="CustomerId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberType", propOrder = { + "customerId", + "amount" +}) +public class MakePaymentMemberType { + + @XmlElement(name = "CustomerId", required = true) + protected String customerId; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the customerId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustomerId() { + return customerId; + } + + /** + * Sets the value of the customerId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustomerId(String value) { + this.customerId = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java new file mode 100644 index 0000000000..b069b2ba94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.payment package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MakePaymentMember_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMember"); + private final static QName _MakePaymentMemberResponse_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMemberResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.payment + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link MakePaymentMemberResponseType } + * + */ + public MakePaymentMemberResponseType createMakePaymentMemberResponseType() { + return new MakePaymentMemberResponseType(); + } + + /** + * Create an instance of {@link MakePaymentMemberType } + * + */ + public MakePaymentMemberType createMakePaymentMemberType() { + return new MakePaymentMemberType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMember") + public JAXBElement<MakePaymentMemberType> createMakePaymentMember(MakePaymentMemberType value) { + return new JAXBElement<MakePaymentMemberType>(_MakePaymentMember_QNAME, MakePaymentMemberType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMemberResponse") + public JAXBElement<MakePaymentMemberResponseType> createMakePaymentMemberResponse(MakePaymentMemberResponseType value) { + return new JAXBElement<MakePaymentMemberResponseType>(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/Payment.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/Payment.java new file mode 100644 index 0000000000..bbbd03d89a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/Payment.java @@ -0,0 +1,43 @@ + +package com.tuscanyscatours.payment; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "Payment", targetNamespace = "http://www.tuscanyscatours.com/Payment/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Payment { + + + /** + * + * @param amount + * @param customerId + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/Payment/makePayment") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "makePaymentMember", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberType") + @ResponseWrapper(localName = "makePaymentMemberResponse", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberResponseType") + public String makePaymentMember( + @WebParam(name = "CustomerId", targetNamespace = "") + String customerId, + @WebParam(name = "Amount", targetNamespace = "") + float amount); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/PaymentService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/PaymentService.java new file mode 100644 index 0000000000..a430175976 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/PaymentService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "PaymentService", targetNamespace = "http://www.tuscanyscatours.com/Payment/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl") +public class PaymentService + extends Service +{ + + private final static URL PAYMENTSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.payment.PaymentService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.payment.PaymentService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + PAYMENTSERVICE_WSDL_LOCATION = url; + } + + public PaymentService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public PaymentService() { + super(PAYMENTSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/Payment/", "PaymentService")); + } + + /** + * + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/package-info.java new file mode 100644 index 0000000000..acd208f5c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/com/tuscanyscatours/payment/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/Payment/") +package com.tuscanyscatours.payment; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..41f78e4109 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-callback/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,73 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-java-callback")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment1 = client.getService(Payment.class, "Payment1"); + Payment payment2 = client.getService(Payment.class, "Payment2"); + Payment paymentConfirm = client.getService(Payment.class, "PaymentConfirm"); + Payment paymentCallbackID = client.getService(Payment.class, "PaymentCallbackID"); + Payment paymentCallbackRedirect = client.getService(Payment.class, "PaymentCallbackRedirect"); + + System.out.println("==================================================="); + System.out.println("\n\nPayment1 under limit - Status = \n\n" + payment1.makePaymentMember("c-0", 100.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment2 under limit - Status = \n\n" + payment2.makePaymentMember("c-0", 100.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment1 over limit - Status = \n\n" + payment1.makePaymentMember("c-0", 1500.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment2 over limit - Status = \n\n" + payment2.makePaymentMember("c-0", 1500.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPayment2 using request context - Status = \n\n" + payment2.makePaymentMember("c-0", 20000.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPaymentConfirm - Status = \n\n" + paymentConfirm.makePaymentMember("c-0", 20000.00f)); + System.out.println("==================================================="); + + // wait for longer that the asynch payment processing waits. + try { + Thread.sleep(2000); + } catch (Exception ex) { + // do nothing + } + + System.out.println("==================================================="); + System.out.println("\n\nPaymentCallbackID - Status = \n\n" + paymentCallbackID.makePaymentMember("c-0", 20000.00f)); + System.out.println("==================================================="); + System.out.println("\n\nPaymentCallbackRedirect - Status = \n\n" + paymentCallbackRedirect.makePaymentMember("c-0", 20000.00f)); + System.out.println("==================================================="); + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/build.xml new file mode 100644 index 0000000000..9579c408ff --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-payment-java-policy" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.payment.PaymentLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/pom.xml new file mode 100644 index 0000000000..4d6823400c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/pom.xml @@ -0,0 +1,115 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-payment-java-policy</artifactId> + <name>Apache Tuscany SCA Tours Payment Java Policy Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>javax.xml.ws</groupId> + <artifactId>jaxws-api</artifactId> + <version>2.1</version> + <exclusions> + <exclusion> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.payment.PaymentLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java new file mode 100644 index 0000000000..e5f3ef3cad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberResponseType", propOrder = { + "status" +}) +public class MakePaymentMemberResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java new file mode 100644 index 0000000000..ca94d86628 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java @@ -0,0 +1,82 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="CustomerId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberType", propOrder = { + "customerId", + "amount" +}) +public class MakePaymentMemberType { + + @XmlElement(name = "CustomerId", required = true) + protected String customerId; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the customerId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustomerId() { + return customerId; + } + + /** + * Sets the value of the customerId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustomerId(String value) { + this.customerId = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java new file mode 100644 index 0000000000..b069b2ba94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.payment package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MakePaymentMember_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMember"); + private final static QName _MakePaymentMemberResponse_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMemberResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.payment + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link MakePaymentMemberResponseType } + * + */ + public MakePaymentMemberResponseType createMakePaymentMemberResponseType() { + return new MakePaymentMemberResponseType(); + } + + /** + * Create an instance of {@link MakePaymentMemberType } + * + */ + public MakePaymentMemberType createMakePaymentMemberType() { + return new MakePaymentMemberType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMember") + public JAXBElement<MakePaymentMemberType> createMakePaymentMember(MakePaymentMemberType value) { + return new JAXBElement<MakePaymentMemberType>(_MakePaymentMember_QNAME, MakePaymentMemberType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMemberResponse") + public JAXBElement<MakePaymentMemberResponseType> createMakePaymentMemberResponse(MakePaymentMemberResponseType value) { + return new JAXBElement<MakePaymentMemberResponseType>(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/Payment.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/Payment.java new file mode 100644 index 0000000000..bbbd03d89a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/Payment.java @@ -0,0 +1,43 @@ + +package com.tuscanyscatours.payment; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "Payment", targetNamespace = "http://www.tuscanyscatours.com/Payment/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Payment { + + + /** + * + * @param amount + * @param customerId + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/Payment/makePayment") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "makePaymentMember", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberType") + @ResponseWrapper(localName = "makePaymentMemberResponse", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberResponseType") + public String makePaymentMember( + @WebParam(name = "CustomerId", targetNamespace = "") + String customerId, + @WebParam(name = "Amount", targetNamespace = "") + float amount); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/PaymentService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/PaymentService.java new file mode 100644 index 0000000000..a430175976 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/PaymentService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "PaymentService", targetNamespace = "http://www.tuscanyscatours.com/Payment/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl") +public class PaymentService + extends Service +{ + + private final static URL PAYMENTSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.payment.PaymentService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.payment.PaymentService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + PAYMENTSERVICE_WSDL_LOCATION = url; + } + + public PaymentService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public PaymentService() { + super(PAYMENTSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/Payment/", "PaymentService")); + } + + /** + * + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/package-info.java new file mode 100644 index 0000000000..acd208f5c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/com/tuscanyscatours/payment/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/Payment/") +package com.tuscanyscatours.payment; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..e5bd98ff2b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-policy/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,47 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-java-policy"), + locate("creditcard-payment-jaxb-policy")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("Payment Java Policy test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/build.xml new file mode 100644 index 0000000000..c61fe810a4 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-payment-java-reference-pass" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.payment.PaymentLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/pom.xml new file mode 100644 index 0000000000..6046fcab91 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/pom.xml @@ -0,0 +1,115 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-payment-java-reference-pass</artifactId> + <name>Apache Tuscany SCA Tours Payment Java Callback Reference Pass</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>javax.xml.ws</groupId> + <artifactId>jaxws-api</artifactId> + <version>2.1</version> + <exclusions> + <exclusion> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.payment.PaymentLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java new file mode 100644 index 0000000000..e5f3ef3cad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberResponseType", propOrder = { + "status" +}) +public class MakePaymentMemberResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java new file mode 100644 index 0000000000..ca94d86628 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java @@ -0,0 +1,82 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="CustomerId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberType", propOrder = { + "customerId", + "amount" +}) +public class MakePaymentMemberType { + + @XmlElement(name = "CustomerId", required = true) + protected String customerId; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the customerId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustomerId() { + return customerId; + } + + /** + * Sets the value of the customerId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustomerId(String value) { + this.customerId = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java new file mode 100644 index 0000000000..b069b2ba94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.payment package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MakePaymentMember_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMember"); + private final static QName _MakePaymentMemberResponse_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMemberResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.payment + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link MakePaymentMemberResponseType } + * + */ + public MakePaymentMemberResponseType createMakePaymentMemberResponseType() { + return new MakePaymentMemberResponseType(); + } + + /** + * Create an instance of {@link MakePaymentMemberType } + * + */ + public MakePaymentMemberType createMakePaymentMemberType() { + return new MakePaymentMemberType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMember") + public JAXBElement<MakePaymentMemberType> createMakePaymentMember(MakePaymentMemberType value) { + return new JAXBElement<MakePaymentMemberType>(_MakePaymentMember_QNAME, MakePaymentMemberType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMemberResponse") + public JAXBElement<MakePaymentMemberResponseType> createMakePaymentMemberResponse(MakePaymentMemberResponseType value) { + return new JAXBElement<MakePaymentMemberResponseType>(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/Payment.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/Payment.java new file mode 100644 index 0000000000..bbbd03d89a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/Payment.java @@ -0,0 +1,43 @@ + +package com.tuscanyscatours.payment; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "Payment", targetNamespace = "http://www.tuscanyscatours.com/Payment/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Payment { + + + /** + * + * @param amount + * @param customerId + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/Payment/makePayment") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "makePaymentMember", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberType") + @ResponseWrapper(localName = "makePaymentMemberResponse", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberResponseType") + public String makePaymentMember( + @WebParam(name = "CustomerId", targetNamespace = "") + String customerId, + @WebParam(name = "Amount", targetNamespace = "") + float amount); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/PaymentService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/PaymentService.java new file mode 100644 index 0000000000..a430175976 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/PaymentService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "PaymentService", targetNamespace = "http://www.tuscanyscatours.com/Payment/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl") +public class PaymentService + extends Service +{ + + private final static URL PAYMENTSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.payment.PaymentService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.payment.PaymentService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + PAYMENTSERVICE_WSDL_LOCATION = url; + } + + public PaymentService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public PaymentService() { + super(PAYMENTSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/Payment/", "PaymentService")); + } + + /** + * + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/package-info.java new file mode 100644 index 0000000000..acd208f5c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/com/tuscanyscatours/payment/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/Payment/") +package com.tuscanyscatours.payment; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..5385eb342e --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java-reference-pass/src/main/java/scatours/payment/PaymentLauncher.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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-java-reference-pass")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("==================================================="); + System.out.println("\n\nPayment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("==================================================="); + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/build.xml new file mode 100644 index 0000000000..1e3c69119f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-payment-java" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.payment.PaymentLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/pom.xml new file mode 100644 index 0000000000..2a2bb63532 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/pom.xml @@ -0,0 +1,115 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-payment-java</artifactId> + <name>Apache Tuscany SCA Tours Payment Java Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>javax.xml.ws</groupId> + <artifactId>jaxws-api</artifactId> + <version>2.1</version> + <exclusions> + <exclusion> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.payment.PaymentLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java new file mode 100644 index 0000000000..e5f3ef3cad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberResponseType", propOrder = { + "status" +}) +public class MakePaymentMemberResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java new file mode 100644 index 0000000000..ca94d86628 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java @@ -0,0 +1,82 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="CustomerId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberType", propOrder = { + "customerId", + "amount" +}) +public class MakePaymentMemberType { + + @XmlElement(name = "CustomerId", required = true) + protected String customerId; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the customerId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustomerId() { + return customerId; + } + + /** + * Sets the value of the customerId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustomerId(String value) { + this.customerId = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java new file mode 100644 index 0000000000..b069b2ba94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.payment package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MakePaymentMember_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMember"); + private final static QName _MakePaymentMemberResponse_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMemberResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.payment + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link MakePaymentMemberResponseType } + * + */ + public MakePaymentMemberResponseType createMakePaymentMemberResponseType() { + return new MakePaymentMemberResponseType(); + } + + /** + * Create an instance of {@link MakePaymentMemberType } + * + */ + public MakePaymentMemberType createMakePaymentMemberType() { + return new MakePaymentMemberType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMember") + public JAXBElement<MakePaymentMemberType> createMakePaymentMember(MakePaymentMemberType value) { + return new JAXBElement<MakePaymentMemberType>(_MakePaymentMember_QNAME, MakePaymentMemberType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMemberResponse") + public JAXBElement<MakePaymentMemberResponseType> createMakePaymentMemberResponse(MakePaymentMemberResponseType value) { + return new JAXBElement<MakePaymentMemberResponseType>(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/Payment.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/Payment.java new file mode 100644 index 0000000000..bbbd03d89a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/Payment.java @@ -0,0 +1,43 @@ + +package com.tuscanyscatours.payment; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "Payment", targetNamespace = "http://www.tuscanyscatours.com/Payment/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Payment { + + + /** + * + * @param amount + * @param customerId + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/Payment/makePayment") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "makePaymentMember", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberType") + @ResponseWrapper(localName = "makePaymentMemberResponse", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberResponseType") + public String makePaymentMember( + @WebParam(name = "CustomerId", targetNamespace = "") + String customerId, + @WebParam(name = "Amount", targetNamespace = "") + float amount); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/PaymentService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/PaymentService.java new file mode 100644 index 0000000000..a430175976 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/PaymentService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "PaymentService", targetNamespace = "http://www.tuscanyscatours.com/Payment/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl") +public class PaymentService + extends Service +{ + + private final static URL PAYMENTSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.payment.PaymentService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.payment.PaymentService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + PAYMENTSERVICE_WSDL_LOCATION = url; + } + + public PaymentService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public PaymentService() { + super(PAYMENTSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/Payment/", "PaymentService")); + } + + /** + * + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/package-info.java new file mode 100644 index 0000000000..acd208f5c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/com/tuscanyscatours/payment/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/Payment/") +package com.tuscanyscatours.payment; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..8d5cc8765d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-java/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,47 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-java"), + locate("creditcard-payment-jaxb")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("Payment Java test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/build.xml new file mode 100644 index 0000000000..b6e3f72127 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-payment-python" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.payment.PaymentLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/pom.xml new file mode 100644 index 0000000000..97ba34d3ab --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/pom.xml @@ -0,0 +1,122 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-payment-python</artifactId> + <name>Apache Tuscany SCA Tours Payment Python Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>javax.xml.ws</groupId> + <artifactId>jaxws-api</artifactId> + <version>2.1</version> + <exclusions> + <exclusion> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-script</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.payment.PaymentLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java new file mode 100644 index 0000000000..0e4e9726de --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/EmailGateway.java @@ -0,0 +1,40 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "EmailGateway", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface EmailGateway { + + + /** + * + * @param email + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/EmailGateway/sendEmail") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "sendEmail", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/", className = "com.tuscanyscatours.emailgateway.SendEmailType") + @ResponseWrapper(localName = "sendEmailResponse", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/", className = "com.tuscanyscatours.emailgateway.SendEmailResponseType") + public String sendEmail( + @WebParam(name = "Email", targetNamespace = "") + EmailType email); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/EmailGatewayService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/EmailGatewayService.java new file mode 100644 index 0000000000..8f87855dd9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/EmailGatewayService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.emailgateway; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "EmailGatewayService", targetNamespace = "http://www.tuscanyscatours.com/EmailGateway/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl") +public class EmailGatewayService + extends Service +{ + + private final static URL EMAILGATEWAYSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.emailgateway.EmailGatewayService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.emailgateway.EmailGatewayService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-groovy/src/main/resources/EmailGateway.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + EMAILGATEWAYSERVICE_WSDL_LOCATION = url; + } + + public EmailGatewayService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public EmailGatewayService() { + super(EMAILGATEWAYSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/EmailGateway/", "EmailGatewayService")); + } + + /** + * + * @return + * returns EmailGateway + */ + @WebEndpoint(name = "EmailGatewayPort") + public EmailGateway getEmailGatewayPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/EmailGateway/", "EmailGatewayPort"), EmailGateway.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns EmailGateway + */ + @WebEndpoint(name = "EmailGatewayPort") + public EmailGateway getEmailGatewayPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/EmailGateway/", "EmailGatewayPort"), EmailGateway.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/EmailType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/EmailType.java new file mode 100644 index 0000000000..25935d2303 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/EmailType.java @@ -0,0 +1,118 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for EmailType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="EmailType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="To" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Title" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Body" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "EmailType", propOrder = { + "to", + "title", + "body" +}) +public class EmailType { + + @XmlElement(name = "To", required = true) + protected String to; + @XmlElement(name = "Title", required = true) + protected String title; + @XmlElement(name = "Body", required = true) + protected String body; + + /** + * Gets the value of the to property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTo() { + return to; + } + + /** + * Sets the value of the to property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTo(String value) { + this.to = value; + } + + /** + * Gets the value of the title property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTitle() { + return title; + } + + /** + * Sets the value of the title property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTitle(String value) { + this.title = value; + } + + /** + * Gets the value of the body property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBody() { + return body; + } + + /** + * Sets the value of the body property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBody(String value) { + this.body = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/ObjectFactory.java new file mode 100644 index 0000000000..f414bb3eb3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/ObjectFactory.java @@ -0,0 +1,79 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.emailgateway package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _SendEmailResponse_QNAME = new QName("http://www.tuscanyscatours.com/EmailGateway/", "sendEmailResponse"); + private final static QName _SendEmail_QNAME = new QName("http://www.tuscanyscatours.com/EmailGateway/", "sendEmail"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.emailgateway + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link SendEmailType } + * + */ + public SendEmailType createSendEmailType() { + return new SendEmailType(); + } + + /** + * Create an instance of {@link EmailType } + * + */ + public EmailType createEmailType() { + return new EmailType(); + } + + /** + * Create an instance of {@link SendEmailResponseType } + * + */ + public SendEmailResponseType createSendEmailResponseType() { + return new SendEmailResponseType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SendEmailResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/EmailGateway/", name = "sendEmailResponse") + public JAXBElement<SendEmailResponseType> createSendEmailResponse(SendEmailResponseType value) { + return new JAXBElement<SendEmailResponseType>(_SendEmailResponse_QNAME, SendEmailResponseType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SendEmailType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/EmailGateway/", name = "sendEmail") + public JAXBElement<SendEmailType> createSendEmail(SendEmailType value) { + return new JAXBElement<SendEmailType>(_SendEmail_QNAME, SendEmailType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/SendEmailResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/SendEmailResponseType.java new file mode 100644 index 0000000000..6d366b7554 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/SendEmailResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for SendEmailResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="SendEmailResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SendEmailResponseType", propOrder = { + "status" +}) +public class SendEmailResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/SendEmailType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/SendEmailType.java new file mode 100644 index 0000000000..cc8e15366c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/SendEmailType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.emailgateway; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for SendEmailType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="SendEmailType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Email" type="{http://www.tuscanyscatours.com/EmailGateway/}EmailType"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SendEmailType", propOrder = { + "email" +}) +public class SendEmailType { + + @XmlElement(name = "Email", required = true) + protected EmailType email; + + /** + * Gets the value of the email property. + * + * @return + * possible object is + * {@link EmailType } + * + */ + public EmailType getEmail() { + return email; + } + + /** + * Sets the value of the email property. + * + * @param value + * allowed object is + * {@link EmailType } + * + */ + public void setEmail(EmailType value) { + this.email = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/package-info.java new file mode 100644 index 0000000000..2c2d603ada --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/emailgateway/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/EmailGateway/") +package com.tuscanyscatours.emailgateway; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java new file mode 100644 index 0000000000..e5f3ef3cad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberResponseType", propOrder = { + "status" +}) +public class MakePaymentMemberResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java new file mode 100644 index 0000000000..ca94d86628 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java @@ -0,0 +1,82 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="CustomerId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberType", propOrder = { + "customerId", + "amount" +}) +public class MakePaymentMemberType { + + @XmlElement(name = "CustomerId", required = true) + protected String customerId; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the customerId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustomerId() { + return customerId; + } + + /** + * Sets the value of the customerId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustomerId(String value) { + this.customerId = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java new file mode 100644 index 0000000000..b069b2ba94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.payment package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MakePaymentMember_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMember"); + private final static QName _MakePaymentMemberResponse_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMemberResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.payment + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link MakePaymentMemberResponseType } + * + */ + public MakePaymentMemberResponseType createMakePaymentMemberResponseType() { + return new MakePaymentMemberResponseType(); + } + + /** + * Create an instance of {@link MakePaymentMemberType } + * + */ + public MakePaymentMemberType createMakePaymentMemberType() { + return new MakePaymentMemberType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMember") + public JAXBElement<MakePaymentMemberType> createMakePaymentMember(MakePaymentMemberType value) { + return new JAXBElement<MakePaymentMemberType>(_MakePaymentMember_QNAME, MakePaymentMemberType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMemberResponse") + public JAXBElement<MakePaymentMemberResponseType> createMakePaymentMemberResponse(MakePaymentMemberResponseType value) { + return new JAXBElement<MakePaymentMemberResponseType>(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/Payment.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/Payment.java new file mode 100644 index 0000000000..bbbd03d89a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/Payment.java @@ -0,0 +1,43 @@ + +package com.tuscanyscatours.payment; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "Payment", targetNamespace = "http://www.tuscanyscatours.com/Payment/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Payment { + + + /** + * + * @param amount + * @param customerId + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/Payment/makePayment") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "makePaymentMember", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberType") + @ResponseWrapper(localName = "makePaymentMemberResponse", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberResponseType") + public String makePaymentMember( + @WebParam(name = "CustomerId", targetNamespace = "") + String customerId, + @WebParam(name = "Amount", targetNamespace = "") + float amount); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/PaymentService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/PaymentService.java new file mode 100644 index 0000000000..a430175976 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/PaymentService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "PaymentService", targetNamespace = "http://www.tuscanyscatours.com/Payment/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl") +public class PaymentService + extends Service +{ + + private final static URL PAYMENTSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.payment.PaymentService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.payment.PaymentService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + PAYMENTSERVICE_WSDL_LOCATION = url; + } + + public PaymentService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public PaymentService() { + super(PAYMENTSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/Payment/", "PaymentService")); + } + + /** + * + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/package-info.java new file mode 100644 index 0000000000..acd208f5c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/com/tuscanyscatours/payment/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/Payment/") +package com.tuscanyscatours.payment; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..bb94cf8642 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-python/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,47 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-python"), + locate("creditcard-payment-jaxb"), + locate("emailgateway")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment"); + + System.out.println("Payment Python test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/build.xml new file mode 100644 index 0000000000..6ccd55f641 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-payment-spring-scatag" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.payment.PaymentLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/pom.xml new file mode 100644 index 0000000000..c44f53ad1a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/pom.xml @@ -0,0 +1,129 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-payment-spring-scatag</artifactId> + <name>Apache Tuscany SCA Tours Payment Spring SCATag Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>javax.xml.ws</groupId> + <artifactId>jaxws-api</artifactId> + <version>2.1</version> + <exclusions> + <exclusion> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-spring</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-spring-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.payment.PaymentLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java new file mode 100644 index 0000000000..e5f3ef3cad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberResponseType", propOrder = { + "status" +}) +public class MakePaymentMemberResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java new file mode 100644 index 0000000000..ca94d86628 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java @@ -0,0 +1,82 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="CustomerId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberType", propOrder = { + "customerId", + "amount" +}) +public class MakePaymentMemberType { + + @XmlElement(name = "CustomerId", required = true) + protected String customerId; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the customerId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustomerId() { + return customerId; + } + + /** + * Sets the value of the customerId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustomerId(String value) { + this.customerId = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java new file mode 100644 index 0000000000..b069b2ba94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.payment package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MakePaymentMember_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMember"); + private final static QName _MakePaymentMemberResponse_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMemberResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.payment + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link MakePaymentMemberResponseType } + * + */ + public MakePaymentMemberResponseType createMakePaymentMemberResponseType() { + return new MakePaymentMemberResponseType(); + } + + /** + * Create an instance of {@link MakePaymentMemberType } + * + */ + public MakePaymentMemberType createMakePaymentMemberType() { + return new MakePaymentMemberType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMember") + public JAXBElement<MakePaymentMemberType> createMakePaymentMember(MakePaymentMemberType value) { + return new JAXBElement<MakePaymentMemberType>(_MakePaymentMember_QNAME, MakePaymentMemberType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMemberResponse") + public JAXBElement<MakePaymentMemberResponseType> createMakePaymentMemberResponse(MakePaymentMemberResponseType value) { + return new JAXBElement<MakePaymentMemberResponseType>(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/Payment.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/Payment.java new file mode 100644 index 0000000000..bbbd03d89a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/Payment.java @@ -0,0 +1,43 @@ + +package com.tuscanyscatours.payment; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "Payment", targetNamespace = "http://www.tuscanyscatours.com/Payment/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Payment { + + + /** + * + * @param amount + * @param customerId + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/Payment/makePayment") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "makePaymentMember", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberType") + @ResponseWrapper(localName = "makePaymentMemberResponse", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberResponseType") + public String makePaymentMember( + @WebParam(name = "CustomerId", targetNamespace = "") + String customerId, + @WebParam(name = "Amount", targetNamespace = "") + float amount); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/PaymentService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/PaymentService.java new file mode 100644 index 0000000000..a430175976 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/PaymentService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "PaymentService", targetNamespace = "http://www.tuscanyscatours.com/Payment/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl") +public class PaymentService + extends Service +{ + + private final static URL PAYMENTSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.payment.PaymentService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.payment.PaymentService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + PAYMENTSERVICE_WSDL_LOCATION = url; + } + + public PaymentService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public PaymentService() { + super(PAYMENTSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/Payment/", "PaymentService")); + } + + /** + * + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/package-info.java new file mode 100644 index 0000000000..acd208f5c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/com/tuscanyscatours/payment/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/Payment/") +package com.tuscanyscatours.payment; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..5760fe0d72 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring-scatag/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,47 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-spring-scatag"), + locate("creditcard-payment-jaxb")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment/Payment"); + + System.out.println("Payment Spring SCATag test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/build.xml new file mode 100644 index 0000000000..73cdf2da6a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-payment-spring" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.payment.PaymentLauncher" fork="true" failonerror="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/pom.xml new file mode 100644 index 0000000000..013c7e1482 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/pom.xml @@ -0,0 +1,129 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-payment-spring</artifactId> + <name>Apache Tuscany SCA Tours Payment Spring Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>2.1</version> + </dependency> + + <dependency> + <groupId>javax.xml.ws</groupId> + <artifactId>jaxws-api</artifactId> + <version>2.1</version> + <exclusions> + <exclusion> + <groupId>javax.xml.soap</groupId> + <artifactId>saaj-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-spring</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-spring-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.payment.PaymentLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java new file mode 100644 index 0000000000..e5f3ef3cad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberResponseType.java @@ -0,0 +1,62 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberResponseType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberResponseType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberResponseType", propOrder = { + "status" +}) +public class MakePaymentMemberResponseType { + + @XmlElement(name = "Status", required = true) + protected String status; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java new file mode 100644 index 0000000000..ca94d86628 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/MakePaymentMemberType.java @@ -0,0 +1,82 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for MakePaymentMemberType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType name="MakePaymentMemberType"> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="CustomerId" type="{http://www.w3.org/2001/XMLSchema}string"/> + * <element name="Amount" type="{http://www.w3.org/2001/XMLSchema}float"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </pre> + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MakePaymentMemberType", propOrder = { + "customerId", + "amount" +}) +public class MakePaymentMemberType { + + @XmlElement(name = "CustomerId", required = true) + protected String customerId; + @XmlElement(name = "Amount") + protected float amount; + + /** + * Gets the value of the customerId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCustomerId() { + return customerId; + } + + /** + * Sets the value of the customerId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCustomerId(String value) { + this.customerId = value; + } + + /** + * Gets the value of the amount property. + * + */ + public float getAmount() { + return amount; + } + + /** + * Sets the value of the amount property. + * + */ + public void setAmount(float value) { + this.amount = value; + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java new file mode 100644 index 0000000000..b069b2ba94 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/ObjectFactory.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.tuscanyscatours.payment package. + * <p>An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _MakePaymentMember_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMember"); + private final static QName _MakePaymentMemberResponse_QNAME = new QName("http://www.tuscanyscatours.com/Payment/", "makePaymentMemberResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.tuscanyscatours.payment + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link MakePaymentMemberResponseType } + * + */ + public MakePaymentMemberResponseType createMakePaymentMemberResponseType() { + return new MakePaymentMemberResponseType(); + } + + /** + * Create an instance of {@link MakePaymentMemberType } + * + */ + public MakePaymentMemberType createMakePaymentMemberType() { + return new MakePaymentMemberType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMember") + public JAXBElement<MakePaymentMemberType> createMakePaymentMember(MakePaymentMemberType value) { + return new JAXBElement<MakePaymentMemberType>(_MakePaymentMember_QNAME, MakePaymentMemberType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MakePaymentMemberResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.tuscanyscatours.com/Payment/", name = "makePaymentMemberResponse") + public JAXBElement<MakePaymentMemberResponseType> createMakePaymentMemberResponse(MakePaymentMemberResponseType value) { + return new JAXBElement<MakePaymentMemberResponseType>(_MakePaymentMemberResponse_QNAME, MakePaymentMemberResponseType.class, null, value); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/Payment.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/Payment.java new file mode 100644 index 0000000000..bbbd03d89a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/Payment.java @@ -0,0 +1,43 @@ + +package com.tuscanyscatours.payment; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebService(name = "Payment", targetNamespace = "http://www.tuscanyscatours.com/Payment/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface Payment { + + + /** + * + * @param amount + * @param customerId + * @return + * returns java.lang.String + */ + @WebMethod(action = "http://www.tuscanyscatours.com/Payment/makePayment") + @WebResult(name = "Status", targetNamespace = "") + @RequestWrapper(localName = "makePaymentMember", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberType") + @ResponseWrapper(localName = "makePaymentMemberResponse", targetNamespace = "http://www.tuscanyscatours.com/Payment/", className = "com.tuscanyscatours.payment.MakePaymentMemberResponseType") + public String makePaymentMember( + @WebParam(name = "CustomerId", targetNamespace = "") + String customerId, + @WebParam(name = "Amount", targetNamespace = "") + float amount); + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/PaymentService.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/PaymentService.java new file mode 100644 index 0000000000..a430175976 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/PaymentService.java @@ -0,0 +1,71 @@ + +package com.tuscanyscatours.payment; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.1.7-b01- + * Generated source version: 2.1 + * + */ +@WebServiceClient(name = "PaymentService", targetNamespace = "http://www.tuscanyscatours.com/Payment/", wsdlLocation = "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl") +public class PaymentService + extends Service +{ + + private final static URL PAYMENTSERVICE_WSDL_LOCATION; + private final static Logger logger = Logger.getLogger(com.tuscanyscatours.payment.PaymentService.class.getName()); + + static { + URL url = null; + try { + URL baseUrl; + baseUrl = com.tuscanyscatours.payment.PaymentService.class.getResource("."); + url = new URL(baseUrl, "file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl"); + } catch (MalformedURLException e) { + logger.warning("Failed to create URL for the wsdl Location: 'file:/C:/simon/tuscany/travelsample/contributions/payment-java/src/main/resources/Payment.wsdl', retrying as a local file"); + logger.warning(e.getMessage()); + } + PAYMENTSERVICE_WSDL_LOCATION = url; + } + + public PaymentService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public PaymentService() { + super(PAYMENTSERVICE_WSDL_LOCATION, new QName("http://www.tuscanyscatours.com/Payment/", "PaymentService")); + } + + /** + * + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort() { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. + * @return + * returns Payment + */ + @WebEndpoint(name = "PaymentPort") + public Payment getPaymentPort(WebServiceFeature... features) { + return super.getPort(new QName("http://www.tuscanyscatours.com/Payment/", "PaymentPort"), Payment.class, features); + } + +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/package-info.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/package-info.java new file mode 100644 index 0000000000..acd208f5c9 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/com/tuscanyscatours/payment/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.tuscanyscatours.com/Payment/") +package com.tuscanyscatours.payment; diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/scatours/payment/PaymentLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/scatours/payment/PaymentLauncher.java new file mode 100644 index 0000000000..6917b9c57b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/payment-spring/src/main/java/scatours/payment/PaymentLauncher.java @@ -0,0 +1,47 @@ +/* + * 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.payment; + +import static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import com.tuscanyscatours.payment.Payment; + +public class PaymentLauncher { + + public static void main(String[] args) throws Exception { + SCANode node = SCANodeFactory.newInstance().createSCANode(null, + locate("payment-spring"), + locate("creditcard-payment-jaxb")); + node.start(); + + SCAClient client = (SCAClient)node; + Payment payment = client.getService(Payment.class, "Payment/Payment"); + + System.out.println("Payment Spring test"); + System.out.println("\nSuccessful Payment - Status = \n\n" + payment.makePaymentMember("c-0", 100.00f)); + System.out.println("\n\nFailed Payment - Status = \n\n" + payment.makePaymentMember("c-1", 100.00f)); + + node.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/build.xml new file mode 100644 index 0000000000..57001f70e3 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/build.xml @@ -0,0 +1,35 @@ +<!-- + * 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-policy" default="compile"> + <import file="../../antdefs.xml"/> + <path id="compile-path"> + <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/> + </path> + + <target name="run"> + <java classname="scatours.PolicyLauncher" fork="true"> + <classpath> + <pathelement location="target/${ant.project.name}.jar"/> + <path refid="compile-path"/> + <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/> + </classpath> + </java> + </target> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/maven-eclipse.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/maven-eclipse.xml new file mode 100644 index 0000000000..4ceebd71f7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/maven-eclipse.xml @@ -0,0 +1,8 @@ +<project default="copy-resources"> + <target name="init"/> + <target name="copy-resources" depends="init"> + <copy todir="target/classes/META-INF" filtering="true"> + <fileset dir="." includes="LICENSE|NOTICE"/> + </copy> + </target> +</project>
\ No newline at end of file diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/pom.xml new file mode 100644 index 0000000000..dc72d0c3c0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/pom.xml @@ -0,0 +1,111 @@ +<?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>scatours</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent><version>1.0-SNAPSHOT</version> + <artifactId>scatours-launcher-policy</artifactId> + <name>Apache Tuscany SCA Tours Policy Launcher</name> + + <dependencies> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>scatours-util-launcher-common</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-api</artifactId> + <version>${tuscany.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-axis2</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-node-impl</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-policy-security</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-policy-logging</artifactId> + <version>${tuscany.version}</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifestEntries> + <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path> + </manifestEntries> + <manifest> + <addClasspath>${scatours.selfContained}</addClasspath> + <classpathPrefix>../lib/</classpathPrefix> + <mainClass>scatours.PolicyLauncher</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/src/main/java/scatours/PolicyLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/src/main/java/scatours/PolicyLauncher.java new file mode 100644 index 0000000000..115d747ede --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/policy/src/main/java/scatours/PolicyLauncher.java @@ -0,0 +1,51 @@ +/* + * 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 static scatours.launcher.LauncherUtil.locate; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +public class PolicyLauncher { + + public static void main(String[] args) throws Exception { + SCANode node1 = + SCANodeFactory.newInstance().createSCANode(null, + locate("common"), + locate("policy-client"), + locate("payment-java-policy"), + locate("trip-policy")); + + node1.start(); + + SCANode node2 = SCANodeFactory.newInstance().createSCANode(null, + locate("creditcard-payment-jaxb-policy")); + + node2.start(); + + Runnable client = ((SCAClient)node1).getService(Runnable.class, "TestClient/Runnable"); + client.run(); + + node1.stop(); + node2.stop(); + } +} diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/pom.xml new file mode 100644 index 0000000000..caf076997c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/pom.xml @@ -0,0 +1,81 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launchers</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Tours Launchers</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>blog-feed</module>
+ <module>buildingblocks</module>
+ <module>currency-converter</module>
+ <module>currency-converter-corba</module>
+ <module>currency-converter-jms</module>
+ <module>currency-converter-rmi</module>
+ <module>currency-converter-ws</module>
+ <module>databinding</module>
+ <module>feed-logger</module>
+ <module>interaction</module>
+ <module>introducing</module>
+ <module>introducing-client</module>
+ <module>introducing-domain</module>
+ <module>introducing-tours</module>
+ <module>introducing-trips</module>
+ <module>jumpstart</module>
+ <module>fullapp</module>
+ <module>fullapp-domain</module>
+ <module>fullapp-nodes</module>
+ <module>help-pages</module>
+ <module>notification-ws</module>
+ <module>notification-corba</module>
+ <module>notification-ejb</module>
+ <module>notification-jms</module>
+ <module>notification-rmi</module>
+ <module>payment-java</module>
+ <module>payment-java-callback</module>
+ <module>payment-java-policy</module>
+ <module>payment-java-reference-pass</module>
+ <module>payment-spring</module>
+ <module>payment-spring-scatag</module>
+ <module>payment-bpel</module>
+ <module>payment-groovy</module>
+ <module>payment-python</module>
+ <module>policy</module>
+ <module>using</module>
+ </modules>
+ </profile>
+
+ </profiles>
+
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/build.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/build.xml new file mode 100644 index 0000000000..8fb4c92ef2 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/build.xml @@ -0,0 +1,35 @@ +<!--
+ * 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-using" default="compile">
+ <import file="../../antdefs.xml"/>
+ <path id="compile-path">
+ <pathelement path="../../util/launcher-common/target/scatours-util-launcher-common.jar"/>
+ </path>
+
+ <target name="run">
+ <java classname="scatours.UsingLauncher" fork="true" failonerror="true">
+ <classpath>
+ <pathelement location="target/${ant.project.name}.jar"/>
+ <path refid="compile-path"/>
+ <pathelement location="${env.TUSCANY_HOME}/lib/tuscany-sca-manifest.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/pom.xml b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/pom.xml new file mode 100644 index 0000000000..09e7647fc0 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/pom.xml @@ -0,0 +1,138 @@ +<?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>scatours</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent><version>1.0-SNAPSHOT</version>
+ <artifactId>scatours-launcher-using</artifactId>
+ <name>Apache Tuscany SCA Tours Using Launcher</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>scatours-util-launcher-common</artifactId>
+ <version>${pom.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-all</artifactId>
+ <version>5.2.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-web-demo</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jms-asf</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ejb-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Class-Path>../util/scatours-util-launcher-common.jar</Class-Path>
+ </manifestEntries>
+ <manifest>
+ <addClasspath>${scatours.selfContained}</addClasspath>
+ <classpathPrefix>../lib/</classpathPrefix>
+ <mainClass>scatours.BuildingBlocksLauncher</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/src/main/java/scatours/UsingLauncher.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/src/main/java/scatours/UsingLauncher.java new file mode 100644 index 0000000000..59a2ea427f --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/src/main/java/scatours/UsingLauncher.java @@ -0,0 +1,208 @@ +/*
+ * 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.activemq.broker.BrokerService;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode;
+import org.apache.tuscany.sca.node.SCANodeFactory;
+
+import static scatours.launcher.LauncherUtil.locate;
+
+public class UsingLauncher {
+
+ public static void main(String[] args) throws Exception {
+ runAirportCodes();
+ runBindings();
+ runCarAutowire();
+ runCarPartner();
+ runCarWireElement();
+ runComplexPropertyElement();
+ runComplexPropertyType();
+ runCurrencyConverter();
+ runMultiDomain();
+ runTripAutowire();
+ runTripBooking();
+ runTripWireElement();
+ }
+
+ private static void runAirportCodes() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/airportcodes-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "AirportCodesClient");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runBindings() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/bookings4-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings4Client");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runCarAutowire() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/carbookings3-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings3Client");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runCarPartner() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/carbookings1-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings1Client");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runCarWireElement() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/carbookings2-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "CarBookings2Client");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runComplexPropertyElement() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/orders1-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "Orders1Client");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runComplexPropertyType() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/orders2-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "Orders2Client");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runCurrencyConverter() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/converter-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "ConverterClient");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runMultiDomain() throws Exception {
+ SCANode hotelsNode =
+ SCANodeFactory.newInstance().createSCANode("test-clients/hotelsdomain-client.composite",
+ locate("using"));
+ SCANode toursNode =
+ SCANodeFactory.newInstance().createSCANode("test-clients/toursdomain-client.composite",
+ locate("using"));
+
+ hotelsNode.start();
+ toursNode.start();
+
+ Runnable hotelsClient = ((SCAClient)hotelsNode).getService(Runnable.class, "HotelsDomainClient");
+ hotelsClient.run();
+ Runnable toursClient = ((SCAClient)toursNode).getService(Runnable.class, "ToursDomainClient");
+ toursClient.run();
+
+ toursNode.stop();
+ hotelsNode.stop();
+ }
+
+ private static void runTripAutowire() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/bookings3-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings3Client");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runTripBooking() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/bookings1-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings1Client");
+ client.run();
+
+ node.stop();
+ }
+
+ private static void runTripWireElement() throws Exception {
+ SCANode node =
+ SCANodeFactory.newInstance().createSCANode("test-clients/bookings2-client.composite",
+ locate("using"));
+
+ node.start();
+
+ Runnable client = ((SCAClient)node).getService(Runnable.class, "Bookings2Client");
+ client.run();
+
+ node.stop();
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/src/main/resources/jndi.properties b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/src/main/resources/jndi.properties new file mode 100644 index 0000000000..80236a8e6c --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/src/main/resources/jndi.properties @@ -0,0 +1,38 @@ +## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.Bookings = BookingsRequestQueue
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
diff --git a/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/src/test/java/scatours/UsingTestCase.java b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/src/test/java/scatours/UsingTestCase.java new file mode 100644 index 0000000000..cd643b6649 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-travelsample-1.0/launchers/using/src/test/java/scatours/UsingTestCase.java @@ -0,0 +1,42 @@ +/*
+ * 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.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests the launcher
+ */
+public class UsingTestCase {
+
+ @Before
+ public void startServer() throws Exception {
+ }
+
+ @Test
+ public void testLauncher() throws Exception {
+ UsingLauncher.main(null);
+ }
+
+ @After
+ public void stopServer() throws Exception {
+ }
+}
|