summaryrefslogtreecommitdiffstats
path: root/sandbox/travelsample/launchers/currency-converter-ws-launcher/src/main/java/scatours/LaunchNode.java
diff options
context:
space:
mode:
authormcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68>2009-05-18 22:48:04 +0000
committermcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68>2009-05-18 22:48:04 +0000
commit7a5f98a0184cd9ca1552e92db9edea93ab7a4dcd (patch)
tree95186328b46cb03fe4a7eff4228e88249dbc1de8 /sandbox/travelsample/launchers/currency-converter-ws-launcher/src/main/java/scatours/LaunchNode.java
parent9d5be2f5692eed1a79aacd48c5636726c06395c4 (diff)
Initial attempt at creating a launcher for the currency converter contribution with a basic web service binding
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@776123 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sandbox/travelsample/launchers/currency-converter-ws-launcher/src/main/java/scatours/LaunchNode.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/sandbox/travelsample/launchers/currency-converter-ws-launcher/src/main/java/scatours/LaunchNode.java b/sandbox/travelsample/launchers/currency-converter-ws-launcher/src/main/java/scatours/LaunchNode.java
new file mode 100644
index 0000000000..4a4aa3070a
--- /dev/null
+++ b/sandbox/travelsample/launchers/currency-converter-ws-launcher/src/main/java/scatours/LaunchNode.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 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 LaunchNode {
+
+ public static void main(String[] args) throws Exception {
+ SCAContribution currencyWSContribution =
+ new SCAContribution("currency-ws",
+ "../../contributions/currency-contribution-ws/target/classes");
+ SCAContribution currencyContribution =
+ new SCAContribution("currency",
+ "../../contributions/currency-contribution/target/classes");
+
+ SCANode node = SCANodeFactory.newInstance().createSCANode(
+ "currency-converter-ws.composite",currencyContribution, currencyWSContribution);
+ node.start();
+
+ 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");
+
+ node.stop();
+ }
+}