OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

sca-j message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: NEW ISSUE: @Callback injection could be NULL

TARGET: Java CAA, section 6.2.4 "Accessing Callbacks" [1]

DESCRIPTION: There are situations where the field or setter with an @callback annotation (when used to obtain a reference to a callaback instance) can be injected with NULL. As noted in section 8.2 RequestContext, the getCallback() method might return NULL in certain situations, and those situations might also occur in combination with the use of @callback. For example, suppose a component implements two services, one has a bidirectional interface and the other does not. The component impl could use @callback to get a callback instance. When invoked over the bidirectional service, the @callback will non-null, but will be null when the non-bidirectional service is invoked. AFAIK, the specs don't prohibit the example (nor do I think they should).

There is no pdf for [1] so bear with me:
In section 6.2.4, at the end of the first paragraph (line 395) add the following:

A field or setter method annotated with @callback might be injected or set to NULL if the implementation is invoked through a non-bidirectional service or when invoked as a callback. The component implementation should always check for null before using a callback reference (See also the getCallbackReference() method in section 8.2 "RequestContext").

In section 6.2.4, the first example (line 400) replace the example with the following:

protected ServiceReference<MyCallback> callback;

[1] http://www.oasis-open.org/committees/download.php/31121/sca-javacaa-1.1-spec-cd02-rev2.doc

Dave Booz
STSM, BPM and SCA Architecture
Co-Chair OASIS SCA-Policy TC and SCA-J TC
"Distributed objects first, then world hunger"
Poughkeepsie, NY (845)-435-6093 or 8-295-6093

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]