tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r810848 - /tuscany/branches/sca-java-1.5.1/samples/implementation-composite/src/main/java/composite/TargetImpl.java
Date Thu, 03 Sep 2009 09:44:32 GMT
Author: nash
Date: Thu Sep  3 09:44:31 2009
New Revision: 810848

URL: http://svn.apache.org/viewvc?rev=810848&view=rev
Log:
Modify TargetImpl to use getCallbackReference() instead of injection

Modified:
    tuscany/branches/sca-java-1.5.1/samples/implementation-composite/src/main/java/composite/TargetImpl.java

Modified: tuscany/branches/sca-java-1.5.1/samples/implementation-composite/src/main/java/composite/TargetImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.5.1/samples/implementation-composite/src/main/java/composite/TargetImpl.java?rev=810848&r1=810847&r2=810848&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.5.1/samples/implementation-composite/src/main/java/composite/TargetImpl.java
(original)
+++ tuscany/branches/sca-java-1.5.1/samples/implementation-composite/src/main/java/composite/TargetImpl.java
Thu Sep  3 09:44:31 2009
@@ -18,7 +18,9 @@
  */
 package composite;
 
+import org.osoa.sca.ComponentContext;
 import org.osoa.sca.annotations.Callback;
+import org.osoa.sca.annotations.Context;
 import org.osoa.sca.annotations.Scope;
 import org.osoa.sca.annotations.Service;
 
@@ -27,15 +29,16 @@
 @Scope("COMPOSITE")
 public class TargetImpl implements Target {
 
-    private SourceCallback sourceCallback;
+    private ComponentContext ctx; 
 
-    @Callback
-    public void setSourceCallback(SourceCallback sourceCallback) {
-        this.sourceCallback = sourceCallback;
+    @Context 
+    public void setContext(ComponentContext context) {
+        ctx = context;
     }
 
     public void someMethod(String arg) {
         System.out.println("Target: " + arg);
+        SourceCallback sourceCallback = (SourceCallback)ctx.getRequestContext().getCallbackReference().getService();
         sourceCallback.receiveResult(arg + " -> Target.someMethod");
     }
 }



Mime
View raw message