PS Next I think we should look at context information being passed from the 
application code to the
code involved in a reference invocation...

Folks,

OK, time to delve into this piece of function.

The basic capability of both ComponentContext and RequestContext is to supply information to an implementation when it is invoked. This could include information passed from the Binding implementation to the application (as discussed in the previous email).

However, there is another piece of function which is nowhere described in the SCA specifications - and that is the need for the implementation to be able to convey information to the runtime - and specifically the Binding implementation - when invoking a reference.

This capability has been discussed on the Tuscany list in the past - notably by some users. Examples include providing Authentication context for the call - where the credentials may depend upon the Authentication of the caller of the service (either passed striaght through, or created on the fly by the application).

The question is - how can this be done?

One possibility is to use the RequestContext structure to carry the information - or rather the extended form of TuscanyRequestContext, where we can envisage making the setting of extended context values available to the application:

void setExtendedContext<T>( String contextName, <T> );

Obviously to be useful, there must be some set of "well known" contextName values which the application code and the binding code can use.

However, the principle is simple enough - the application sets up values in the TuscanyRequestContext ahead of the invocation of some reference - and the TuscanyRequestContext is available to the runtime code which implements the reference, including the Binding code.

One interesting question here is how to handle application threads which were not used to invoke a service - eg a thread from a pool created & managed by the application code. At present, such a thread would have no context associated with it - to enable such threads to pass context to references, there is a need for an API to allow a TuscanyRequestContext to be created for such a thread. However, this is perhaps reaching too far at the moment, given that we have not yet agreed the basic function.


Thoughts?

Yours,  Mike.

Reply via email to