Interface CorrelationActivity
-
public interface CorrelationActivity
Activity used to request and receive asynchronously queried correlation data.Asynchronous requests
The procedure to send asynchronous requests is:
- create the activity using the CorrelationProvider.createActivity() method
- get an ActivityContextInterface object for the activity
- attach the SBB local object to the ACI
- send the request using the requestCorrelationData(String) method on the activity
- handle the result in an event handler for the
CorrelationResultEvent
event - handle failures in an event handler for the
CorrelationFailureEvent
event
Example asynchronous request
private void asyncRequest(String correlationId) { try { CorrelationActivity corrActivity = corrProvider.createActivity(); ActivityContextInterface corrAci = corrACIFactory.getActivityContextInterface(corrActivity); corrAci.attach(getSbbLocalObject()); corrActivity.requestCorrelationData(correlationId); } catch (StartActivityException e) { // ... handle exception ... } } public void onCorrelationResult(CorrelationResultEvent result, ActivityContextInterface aci) { aci.detach(getSbbLocalObject()); byte [] corrData = result.getCorrelationData() // ... do something with the data ... } public void onCorrelationFailure(CorrelationFailureEvent failure, ActivityContextInterface aci) { aci.detach(getSbbLocalObject()); // ... handle failure ... }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
peekCorrelationData(String correlationId)
Request the correlation data associated with the specified Correlation ID.void
requestCorrelationData(String correlationId)
Request the correlation data associated with the specified Correlation ID.
-
-
-
Method Detail
-
requestCorrelationData
void requestCorrelationData(String correlationId)
Request the correlation data associated with the specified Correlation ID.The result will be fired as a
CorrelationResultEvent
event on this activity. Failed queries will be fired as aCorrelationFailureEvent
.- Parameters:
correlationId
- the Correlation ID.
-
peekCorrelationData
void peekCorrelationData(String correlationId)
Request the correlation data associated with the specified Correlation ID.
UnlikerequestCorrelationData(String)
this will not remove the stored data. This means that the correlation ID will only be released if- The
get*()
API is used with the same correlation ID, - the
CorrelationProvider.releaseCorrelationID(String)
method is called on the node storing the data, or - the correlation ID expires.
The result will be fired as a
CorrelationResultEvent
event on this activity. Failed queries will be fired as aCorrelationFailureEvent
.- Parameters:
correlationId
- the Correlation ID.
- The
-
-