I'd like to start working on providing support for callbacks, assuming the sandbox is a good place to do this. Currently, I am focusing on local, stateless callbacks to begin with. Later, and assuming that conversational support is in place (which I am also keen on contributing to) I can work on stateful and remote callbacks.
The first basic issue I see is how to incorporate callbacks as defined in the C&I spec in particular, and bi-directional interfaces in general, into the Tuscany architecture. Depending on how closely a RuntimeWire is supposed to correspond to an SCA wire, it seems like one way to incorporate a callback is to extend InboundWire to include an OutboundInvocationChain, and OutboundWire to include an InboundInvocationChain. That is, a wire would include a 'reverse' pair of invocation chain ends to account for a callback.With that in place, it seems feasible to re-use WireInvocationHandler and TargetInvoker in a similar fashion to actually perform the callback invocation. Are there any subtle (or not so subtle) gotchas in this that I am overlooking? Two other basic pieces are: (1) callback injection, and (2) implementation of ServiceReference. Callback injection may be simple enough and similar to reference injection for stateless callbacks, but it'll get more interesting for stateful callbacks (or stateful scopes), as it is not clear that a callback field or method will remain valid for the duration of the component instance, and may need to be re-injected. ServiceReference requires support for RequestContext and includes support for sessions. Since neither of these seem to be implemented, I could take a stab at implementing enough of RequestContext to support ServiceReference, and I could stub out support for sessions for now. On the other hand, ServiceReference is not as critical as, say, the RuntimeWire issue, so I could do without it at a very first try. Thoughts? If it is ok with everyone, I'll create a JIRA to start with stateless callbacks and can someone assign it to me?
