On 04/01/2011 21:59, Simon Nash wrote:
The SCA 1.1 specs prohibit using callback injection with a COMPOSITE
scoped component. Instead, the SCA APIs must be used to obtain the
callback reference. Tuscany should raise an error in this case, and
it would be good to have a JIRA to track this.

Simon


Not only do the OASIS V1.1 specs outlaw using @Callback on a Field or Method of a Java implementation class which is annotated with @Scope(COMPOSITE), but there is even an OASIS compliance test for this too.

Turns out that Tuscany fails the compliance test :-(

I've raised a JIRA:

https://issues.apache.org/jira/browse/TUSCANY-3813

I've also done a fix and uploaded it to the latest Trunk...


The basic message here is:

IF you use Scope(COMPOSITE) on your class - you CAN'T use @Callback on a Field or on a Method to get a Callback object injected. You must use the RequestContext API that SCA provides - see Section 7.2.5 of the SCA Java Common Annotations & APIs spec:

http://docs.oasis-open.org/opencsa/sca-j/sca-javacaa-1.1-spec-csd05.html
http://docs.oasis-open.org/opencsa/sca-j/sca-javacaa-1.1-spec-csd05.pdf

The reason for this is that a COMPOSITE scope component can handle multiple requests (perhaps simultaneously) and so it is not practicable to inject a single Callback object into that component, since each service request will have its own Callback object.


Yours,  Mike.

Reply via email to