Local Stateless Callback

Description

The ability to invoke a service in a non-blocking fashion and receive a stateless callback.

Use cases

1. Simple invocation

Implement infrastructure to support a simple invocation on a service which then performs a stateless callback. This use-case does not include use of SCA APIs such as ServiceReference. The following application artifacts illustrate this:

@Callback(MyServiceCallback.class)
public interface MyService {

    public void someMethod(String arg); 
}

public interface MyServiceCallback {

    public void receiveResult(String result); 
}

public class SomeClientImpl implements AnotherService, MyServiceCallback {

   private MyService myService;

   @Reference

   public void setMyService(MyService service){
                myService = service;
   }

   public void aClientMethod() {
        myService.someMethod("foo");
   }
   
   public void receiveResult(String result) {
       // do something
   }
}

public class MyServiceImpl implements MyService {

    @Callback
    protected MyServiceCallback callback; 

    public void someMethod(String arg) {
        callback.receiveResult(result);
    }
}

Status

Tuscany/TuscanyJava/Scenarios/ConversationalSupport/LocalStatelessCallback (last edited 2009-09-20 22:47:31 by localhost)