summaryrefslogtreecommitdiffstats
path: root/java/sca/samples/helloworld-ws-reference-lean
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-08-25 05:37:43 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-08-25 05:37:43 +0000
commita00b85195f048fd20159f9c0b3785afdd89ec056 (patch)
tree6f5e022fa2f01f328a6706bf8abcbd84f4c18baf /java/sca/samples/helloworld-ws-reference-lean
parentff9010d1a7629a9ed6a907085b8fd14b9b13e849 (diff)
Added a variation of HelloWorldClient that doesn't use any Tuscany specific APIs, only the SCA spec standard programming model. Applied the same idea to calculator in a new calculator-lean module to show how this pattern works with just components (helloworld-ws-reference-lean used a reference with a WS binding). Also started to show how test cases can use the same pattern in calculator-lean.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@688620 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient5.java47
-rw-r--r--java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient5.composite33
2 files changed, 80 insertions, 0 deletions
diff --git a/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient5.java b/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient5.java
new file mode 100644
index 0000000000..7c1853566f
--- /dev/null
+++ b/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient5.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 helloworld;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.osoa.sca.annotations.EagerInit;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+
+/**
+ * The HelloWorld client implementation
+ */
+@Scope("COMPOSITE") @EagerInit
+public class HelloWorldClient5 {
+
+ @Reference
+ public HelloWorldService helloWorldService;
+
+ public final static void main(String[] args) throws Exception {
+ SCADomain scaDomain = SCADomain.newInstance("helloworldwsclient5.composite");
+
+ scaDomain.close();
+ }
+
+ @Init
+ public void doit() {
+ String value = helloWorldService.getGreetings("World");
+ System.out.println(value);
+ }
+} \ No newline at end of file
diff --git a/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient5.composite b/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient5.composite
new file mode 100644
index 0000000000..bbac4c3703
--- /dev/null
+++ b/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient5.composite
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:hw="http://helloworld"
+ name="helloworldwsclient">
+
+ <!-- A component representing the client program -->
+ <component name="HelloWorldClient5">
+ <implementation.java class="helloworld.HelloWorldClient5"/>
+ <reference name="helloWorldService">
+ <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
+ </reference>
+ </component>
+
+</composite>