diff options
Diffstat (limited to '')
-rw-r--r-- | branches/sca-java-1.x/itest/recursive/src/main/java/composite/TargetImpl.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/branches/sca-java-1.x/itest/recursive/src/main/java/composite/TargetImpl.java b/branches/sca-java-1.x/itest/recursive/src/main/java/composite/TargetImpl.java index 86686e9233..e744aa7967 100644 --- a/branches/sca-java-1.x/itest/recursive/src/main/java/composite/TargetImpl.java +++ b/branches/sca-java-1.x/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"); } } |