Local Conversational Callback

Description

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

Use cases

The following represent application artifacts used in the scenarios described below:

@Scope("CONVERSATIONAL")
@Callback(MyServiceCallback.class)
public interface MyService {

    public void someMethod(String arg); 
}

public interface MyServiceCallback {

    @EndSession
    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
   }
}

@Session(maxIdleTime="10 minutes",
         maxAge="1 day",
         singlePrincipal=false)
public class MyServiceImpl implements MyService {

    @Callback
    protected MyServiceCallback callback; 

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

}

1. Non-durable conversation store

Supports the above artifacts and semantics as outlined in the Java C&I Specification. A conversational scope container may be provided that has a pluggable peristent store. Characteristics of this store include:

* It need not support querying of data since persistent items may be retrieved through a unique id * A simple (non-durable) implementation to start (e.g. ConcurrentHashMap) * It should be implented as a system service so other runtime susbsystems can use it

2. Durable transactional store

The same scenario as above except with a durable transaction store. We may want to support specialized serialization to disk using a journaling system such as http://howl.objectweb.org/. We may also want to look at what RM or messaging implementations provide that we could leverage such as Celtix or ActiveMQ. One thing we will need to account for is migration and versioning of serialized information.

3. Support for @SessionID

The ability to inject the session id onto a component implementation as per the Java C&I specification

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