com.flat502.rox.client
Interface AsynchronousResponseHandler

All Known Implementing Classes:
AsyncClientDemo

public interface AsynchronousResponseHandler

This interface represents an RPC response handler.

Callers that want to be notified asynchronously when an RPC method call returns should pass an implementation of this interface to the HttpRpcClient.execute(String, Object[], Class, AsynchronousResponseHandler) or HttpRpcClient.execute(String, Object[], AsynchronousResponseHandler) methods.


Method Summary
 void handleException(RpcCall call, java.lang.Throwable e, RpcResponseContext context)
          This method is called for both local and remote exceptions.
 void handleResponse(RpcCall call, RpcResponse rsp, RpcResponseContext context)
          This method is called when a successful response is received from the server.
 

Method Detail

handleResponse

void handleResponse(RpcCall call,
                    RpcResponse rsp,
                    RpcResponseContext context)
This method is called when a successful response is received from the server.

A successful response is defined as one that contains a return value that is not an RPC fault.

Parameters:
call - The original method call that this response applies to.
rsp - The response to the method call.

handleException

void handleException(RpcCall call,
                     java.lang.Throwable e,
                     RpcResponseContext context)
This method is called for both local and remote exceptions.

A local exception is one that is raised within this JVM as a result of a failure while handling either the request or response. This may be an instance of any sub-class of Throwable other than RpcFaultException.

A remote exception is always an instance of RpcFaultException wrapping an RPC fault response.

Parameters:
call - The original method call that this response applies to.
e - An instance of RpcFaultException for a remote exception. For a local exception any other exception type.