|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.flat502.rox.demo.AsyncClientDemo
public class AsyncClientDemo
A demo asynchronous client illustrating the
HttpRpcClient.execute(String, Object[], Class, AsynchronousResponseHandler)
method and the AsynchronousResponseHandler
interface.
Constructor Summary | |
---|---|
AsyncClientDemo()
|
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 response,
RpcResponseContext context)
This method is called when a successful response is received from the server. |
static void |
main(java.lang.String[] args)
Call each of the exposed methods on the remote demo server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AsyncClientDemo()
Method Detail |
---|
public void handleResponse(RpcCall call, RpcResponse response, RpcResponseContext context)
AsynchronousResponseHandler
A successful response is defined as one that contains a return value that is not an RPC fault.
handleResponse
in interface AsynchronousResponseHandler
call
- The original method call that this response applies to.response
- The response to the method call.public void handleException(RpcCall call, java.lang.Throwable e, RpcResponseContext context)
AsynchronousResponseHandler
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.
handleException
in interface AsynchronousResponseHandler
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.public static void main(java.lang.String[] args)
args
- A list of parameters. Only the first is used and if
present must be the URL of the remote server. This
defaults to http://localhost:8080/
if
not specified.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |