Interface RPCManagerCompletionCallback


public interface RPCManagerCompletionCallback
This interface allows your code to be notified when an RPCManager has completed processing. Call 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).

See Also:
  • Method Summary

    Modifier and Type
    Method
    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
  • Method Details

    • onSuccess

      void onSuccess(DSTransaction dsTransaction) throws Exception
      Called when an RPCManager completes successfully
      Parameters:
      dsTransaction - the datasource transaction.
      Throws:
      Exception
    • onFailure

      void onFailure(DSTransaction dsTransaction, boolean transactionFailed) throws Exception
      Called when an RPCManager fails (ie, at least one of the requests it is managing fails).
      Parameters:
      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 false
      Throws:
      Exception