← Prev in month ← Prev in thread
Next in thread → Next in month →

NEW ISSUE: Incorrect code in section 6.7.2 example

From
Simon Nash <>
Date
2008-09-15T20:58:56+00:00
ID
Thread
NEW ISSUE: Incorrect code in section 6.7.2 example
TARGET: Java Common Annotations and APIs, WD 04, section 6.7.2

DESCRIPTION: Incorrect code in section 6.7.2 example

On line 511, this use of getCallbackID() is incorrect.  This
code should obtain a RequestContext either by injection or from
the ComponentContext, then call RequestContext.getServiceReference()
to get the currently active invocation service reference, then
call getCallbackID() on that.

PROPOSAL:

Replace lines 510 through 511 by:

@Context RequestContext context;

public void receiveResult(String result) {
     Object key = context.getServiceReference().getCallbackID();
← Prev in month ← Prev in thread
Next in thread → Next in month →