diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-03 09:46:06 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-03 09:46:06 +0000 |
commit | d0b48aea3eb3f331e0a6c4d8660e28494cc1bec6 (patch) | |
tree | b3f6360d2628def71088de5d24b4aedee76451d2 | |
parent | aff5630d391450d81822457de16b1b55b7b0e8a5 (diff) |
Modify TargetImpl to use getCallbackReference() instead of injection
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@810850 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | branches/sca-java-1.5.1/itest/recursive/src/main/java/composite/TargetImpl.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/branches/sca-java-1.5.1/itest/recursive/src/main/java/composite/TargetImpl.java b/branches/sca-java-1.5.1/itest/recursive/src/main/java/composite/TargetImpl.java index 86686e9233..e744aa7967 100644 --- a/branches/sca-java-1.5.1/itest/recursive/src/main/java/composite/TargetImpl.java +++ b/branches/sca-java-1.5.1/itest/recursive/src/main/java/composite/TargetImpl.java @@ -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 @@ import org.osoa.sca.annotations.Service; @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"); } } |