summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/testing/itest
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-12-13 09:23:05 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-12-13 09:23:05 +0000
commit2981c1106c1a8d7336d37f59dd105455d21f3c4c (patch)
treeafc1e1156310dd608d26c164467860d55eb9e83a /sca-java-2.x/trunk/testing/itest
parent89244e67bd9014dfca57d61a6b5f75ef4a76d7f5 (diff)
Update to use the new Tuscany ComponentContext and ServiceReference interfaces
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1213624 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest')
-rw-r--r--sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java b/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java
index 17e425c292..9e2ecf2f6e 100644
--- a/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java
+++ b/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java
@@ -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 Helloworld {
@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);
}
}