tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r687211 - in /tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main: java/helloworld/ resources/
Date Wed, 20 Aug 2008 00:43:40 GMT
Author: jsdelfino
Date: Tue Aug 19 17:43:40 2008
New Revision: 687211

URL: http://svn.apache.org/viewvc?rev=687211&view=rev
Log:
Minor code cleanup. Moved different SCDL variations to different composite files. Added one
more variation that shows how to use the SCA ComponentContext interface.

Added:
    tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient4.java
      - copied, changed from r687208, tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient3.java
    tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient2.composite
      - copied, changed from r687208, tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite
    tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient3.composite
      - copied, changed from r687208, tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite
    tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient4.composite
      - copied, changed from r687208, tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite
Modified:
    tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient2.java
    tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient3.java
    tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite

Modified: tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient2.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient2.java?rev=687211&r1=687210&r2=687211&view=diff
==============================================================================
--- tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient2.java
(original)
+++ tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient2.java
Tue Aug 19 17:43:40 2008
@@ -29,24 +29,24 @@
 @Scope("COMPOSITE") @EagerInit
 public class HelloWorldClient2 {
     
-    private static HelloWorldClient2 main;
+    private static HelloWorldClient2 client;
    
     @Reference
     public HelloWorldService helloWorldService;
 
     public HelloWorldClient2() {
-        main = this;
+        client = this;
     }
     
     public  final static void main(String[] args) throws Exception {
-        SCADomain scaDomain = SCADomain.newInstance("helloworldwsclient.composite");
+        SCADomain scaDomain = SCADomain.newInstance("helloworldwsclient2.composite");
         
-        main.doit(args);
+        client.doit(args);
 
         scaDomain.close();
     }
     
-    private void doit(String[] args) {
+    void doit(String[] args) {
         String value = helloWorldService.getGreetings("World");
         System.out.println(value);
     }

Modified: tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient3.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient3.java?rev=687211&r1=687210&r2=687211&view=diff
==============================================================================
--- tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient3.java
(original)
+++ tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient3.java
Tue Aug 19 17:43:40 2008
@@ -33,7 +33,7 @@
     public HelloWorldService helloWorldService;
 
     public  final static void main(String[] args) throws Exception {
-        SCADomain scaDomain = SCADomain.newInstance("helloworldwsclient.composite");
+        SCADomain scaDomain = SCADomain.newInstance("helloworldwsclient3.composite");
         
         scaDomain.getService(HelloWorldClient3.class, "HelloWorldClient3").doit(args);
 

Copied: tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient4.java
(from r687208, tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient3.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient4.java?p2=tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient4.java&p1=tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient3.java&r1=687208&r2=687211&rev=687211&view=diff
==============================================================================
--- tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient3.java
(original)
+++ tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient4.java
Tue Aug 19 17:43:40 2008
@@ -19,29 +19,34 @@
 package helloworld;
 
 import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.annotations.Context;
 import org.osoa.sca.annotations.EagerInit;
-import org.osoa.sca.annotations.Reference;
 import org.osoa.sca.annotations.Scope;
 
 /**
  * The HelloWorld client implementation
  */
 @Scope("COMPOSITE") @EagerInit
-public class HelloWorldClient3 {
+public class HelloWorldClient4 {
     
-    @Reference
-    public HelloWorldService helloWorldService;
+    static ComponentContext clientContext;
 
+    @Context
+    public void setContext(ComponentContext context) {
+        clientContext = context;
+    }
+    
     public  final static void main(String[] args) throws Exception {
-        SCADomain scaDomain = SCADomain.newInstance("helloworldwsclient.composite");
-        
-        scaDomain.getService(HelloWorldClient3.class, "HelloWorldClient3").doit(args);
+        SCADomain scaDomain = SCADomain.newInstance("helloworldwsclient4.composite");
+
+        HelloWorldService helloWorldService = clientContext.getService(HelloWorldService.class,
"helloWorldService");
+        String value = helloWorldService.getGreetings("World");
+        System.out.println(value);
 
         scaDomain.close();
     }
     
     public void doit(String[] args) {
-        String value = helloWorldService.getGreetings("World");
-        System.out.println(value);
     }
 }
\ No newline at end of file

Modified: tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite?rev=687211&r1=687210&r2=687211&view=diff
==============================================================================
--- tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite
(original)
+++ tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite
Tue Aug 19 17:43:40 2008
@@ -30,20 +30,4 @@
       </reference>
     </component>
 
-    <!-- A variation -->
-    <component name="HelloWorldClient2">
-      <implementation.java class="helloworld.HelloWorldClient2"/>
-      <reference name="helloWorldService">
-        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
-      </reference>
-    </component>
-
-    <!-- Another variation -->
-    <component name="HelloWorldClient3">
-      <implementation.java class="helloworld.HelloWorldClient3"/>
-      <reference name="helloWorldService">
-        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
-      </reference>
-    </component>
-
 </composite>

Copied: tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient2.composite
(from r687208, tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient2.composite?p2=tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient2.composite&p1=tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite&r1=687208&r2=687211&rev=687211&view=diff
==============================================================================
--- tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite
(original)
+++ tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient2.composite
Tue Aug 19 17:43:40 2008
@@ -23,14 +23,6 @@
 	name="helloworldwsclient">
     
     <!-- A component representing the client program -->
-    <component name="HelloWorldClient">
-      <implementation.java class="helloworld.HelloWorldClient"/>
-      <reference name="helloWorldService">
-        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
-      </reference>
-    </component>
-
-    <!-- A variation -->
     <component name="HelloWorldClient2">
       <implementation.java class="helloworld.HelloWorldClient2"/>
       <reference name="helloWorldService">
@@ -38,12 +30,4 @@
       </reference>
     </component>
 
-    <!-- Another variation -->
-    <component name="HelloWorldClient3">
-      <implementation.java class="helloworld.HelloWorldClient3"/>
-      <reference name="helloWorldService">
-        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
-      </reference>
-    </component>
-
 </composite>

Copied: tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient3.composite
(from r687208, tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient3.composite?p2=tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient3.composite&p1=tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite&r1=687208&r2=687211&rev=687211&view=diff
==============================================================================
--- tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite
(original)
+++ tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient3.composite
Tue Aug 19 17:43:40 2008
@@ -23,22 +23,6 @@
 	name="helloworldwsclient">
     
     <!-- A component representing the client program -->
-    <component name="HelloWorldClient">
-      <implementation.java class="helloworld.HelloWorldClient"/>
-      <reference name="helloWorldService">
-        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
-      </reference>
-    </component>
-
-    <!-- A variation -->
-    <component name="HelloWorldClient2">
-      <implementation.java class="helloworld.HelloWorldClient2"/>
-      <reference name="helloWorldService">
-        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
-      </reference>
-    </component>
-
-    <!-- Another variation -->
     <component name="HelloWorldClient3">
       <implementation.java class="helloworld.HelloWorldClient3"/>
       <reference name="helloWorldService">

Copied: tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient4.composite
(from r687208, tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient4.composite?p2=tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient4.composite&p1=tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite&r1=687208&r2=687211&rev=687211&view=diff
==============================================================================
--- tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite
(original)
+++ tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient4.composite
Tue Aug 19 17:43:40 2008
@@ -23,25 +23,10 @@
 	name="helloworldwsclient">
     
     <!-- A component representing the client program -->
-    <component name="HelloWorldClient">
-      <implementation.java class="helloworld.HelloWorldClient"/>
-      <reference name="helloWorldService">
-        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
-      </reference>
-    </component>
-
-    <!-- A variation -->
-    <component name="HelloWorldClient2">
-      <implementation.java class="helloworld.HelloWorldClient2"/>
-      <reference name="helloWorldService">
-        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
-      </reference>
-    </component>
-
-    <!-- Another variation -->
-    <component name="HelloWorldClient3">
-      <implementation.java class="helloworld.HelloWorldClient3"/>
+    <component name="HelloWorldClient4">
+      <implementation.java class="helloworld.HelloWorldClient4"/>
       <reference name="helloWorldService">
+        <interface.java interface="helloworld.HelloWorldService"/>
         <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
       </reference>
     </component>



Mime
View raw message