concept callback ID in category system administration

appears as: callback ID, The callback ID
Tuscany SCA in Action

This is an excerpt from Manning's book Tuscany SCA in Action.

Listing 5.6. Client implementation that sets and retrieves the callback ID

Listing 5.6 shows how the callback ID can be used in a callback to correlate the call-back with the original service request and retrieve relevant information for processing the callback. Some of the detail has been omitted in order to focus on the code that deals with the callback ID.

First we’ll need a ServiceReference object in order to set the callback ID. The easiest way to obtain a ServiceReference object is to declare the injected callback as being of type ServiceReference .

To customize the callback ID that will be used for the authorize() call and its associated callback, checkSecurity(), we’ll call the setCallbackID() method on the ServiceReference object, passing the dummy audit ID for this payment.

The checkSecurity() callback method retrieves the callback ID by calling getServiceReference() on the RequestContext object and calling getCallbackID() on the returned ServiceReference object . The callback ID is the audit ID for this payment, and we’ll use this to retrieve the audit record holding the saved payment details.