Author: antelder
Date: Tue Dec 13 09:23:05 2011
New Revision: 1213624

URL: http://svn.apache.org/viewvc?rev=1213624&view=rev
Log:
Update to use the new Tuscany ComponentContext and ServiceReference interfaces

Modified:
    
tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java?rev=1213624&r1=1213623&r2=1213624&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java
 Tue Dec 13 09:23:05 2011
@@ -19,9 +19,9 @@
 
 package org.apache.tuscany.sca.itest;
 
-import org.apache.tuscany.sca.core.context.impl.ServiceReferenceImpl;
+import org.apache.tuscany.sca.runtime.TuscanyComponentContext;
+import org.apache.tuscany.sca.runtime.TuscanyServiceReference;
 import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
 import org.oasisopen.sca.annotation.Context;
 import org.oasisopen.sca.annotation.Reference;
 
@@ -32,14 +32,21 @@ public class HelloworldClient implements
     
     @Context
     public ComponentContext componentContext;
+    
+    @Context
+    public TuscanyComponentContext tuscanyComponentContext;
 
     @Override
     public String sayHello(String name) {
 
-        ServiceReference<Helloworld> sr = 
componentContext.getServiceReference(Helloworld.class, "helloworldService");
+//        ServiceReference<Helloworld> sr = 
componentContext.getServiceReference(Helloworld.class, "helloworldService");
+//        
((ServiceReferenceImpl)sr).setBindingURI("http://localhost:8080/HelloworldService/Helloworld";);
 
-        
((ServiceReferenceImpl)sr).setBindingURI("http://localhost:8080/HelloworldService/Helloworld";);
+        TuscanyServiceReference<Helloworld> tsr = 
tuscanyComponentContext.getServiceReference(Helloworld.class, 
"helloworldService");
+//        TuscanyServiceReference<Helloworld> tsr = 
(TuscanyServiceReference<Helloworld>)componentContext.getServiceReference(Helloworld.class,
 "helloworldService");
+        
tsr.setBindingURI("http://localhost:8080/HelloworldService/Helloworld";);
 
-        return "client: " + sr.getService().sayHello(name);
+        
+        return "client: " + tsr.getService().sayHello(name);
     }
 }


Reply via email to