diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-17 19:51:24 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-17 19:51:24 +0000 |
commit | 432dd8fb555ad9d6dde1b5d220e7a0fe2de51904 (patch) | |
tree | ffdc231e6c6413aaed515297a9f5834087d4d31b /branches/sca-java-1.x/samples/calculator-android/src/calculator/CalculatorClient.java | |
parent | 31cc3f73bea03fb0d8403ed7b5c7adda6c7c9c9a (diff) |
[Work in progress] An Android version of the calculator sample application
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@727494 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | branches/sca-java-1.x/samples/calculator-android/src/calculator/CalculatorClient.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/samples/calculator-android/src/calculator/CalculatorClient.java b/branches/sca-java-1.x/samples/calculator-android/src/calculator/CalculatorClient.java new file mode 100644 index 0000000000..3b977259e8 --- /dev/null +++ b/branches/sca-java-1.x/samples/calculator-android/src/calculator/CalculatorClient.java @@ -0,0 +1,30 @@ +package calculator;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class CalculatorClient {
+ public static void main(String[] args) throws Exception {
+
+
+ SCADomain scaDomain = SCADomain.newInstance("Calculator.composite");
+
+ CalculatorService calculatorService =
+ scaDomain.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ // Calculate
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+
+ scaDomain.close();
+
+ }
+
+}
|