public interface RPCManagerCompletionCallback
RPCManager.registerCallback(com.isomorphic.rpc.RPCManagerCompletionCallback)
, passing an implementation of this interface; its onSuccess() or onFailure() method will be called as appropriate when the RPCManager has completed processing of all its DSRequests, immediately before the response queue is marshalled and serialized, so any changes you make to responses will be reflected in what gets returned to the client. Your callback methods are passed a pointer to the controlling RPCManager. You can obtain the list of requests from DSTransaction.getRequests()
, and you can obtain the response to a given request from DSTransaction.getResponse(com.isomorphic.rpc.BaseRequest)
- this will be null if no response has been created for that request (for example, if an exception has caused queue processing to be abandoned).
RPCManager
, DSRequest
Modifier and Type | Method and Description |
---|---|
void | onFailure(DSTransaction dsTransaction, boolean transactionFailed) Called when an RPCManager fails (ie, at least one of the requests it is managing fails). |
void | onSuccess(DSTransaction dsTransaction) Called when an RPCManager completes successfully |
void onSuccess(DSTransaction dsTransaction) throws java.lang.Exception
dsTransaction
- the datasource transaction.java.lang.Exception
void onFailure(DSTransaction dsTransaction, boolean transactionFailed) throws java.lang.Exception
dsTransaction
- the datasource transaction.transactionFailed
- true if at least one failure happened in a request that was being managed by a user-provided or automatic transaction; otherwise falsejava.lang.Exception