Interface AsynchronousRequestHandler

All Superinterfaces:
All Known Implementing Classes:
AsyncServerDemo, RMIAsyncServerDemo

public interface AsynchronousRequestHandler
extends RequestHandler

Interface for asynchronous RPC method call handlers.

See Also:
HttpRpcServer.registerHandler(String, String, AsynchronousRequestHandler)

Method Summary
 void handleRequest(RpcCall call, RpcCallContext context, ResponseChannel rspChannel)
          Invoked to handle a method call.

Method Detail


void handleRequest(RpcCall call,
                   RpcCallContext context,
                   ResponseChannel rspChannel)
                   throws java.lang.Exception
Invoked to handle a method call.

This method is responsible for processing the method asynchronously. Responses can be sent using the ResponseChannel.respond(RpcResponse) method.

Although an implement could do all of its work using the calling thread the intention of this interface is to support handing off the work to an application thread.

The caller is one of the underlying worker threads (see HttpRpcProcessor.addWorker()) and as such should process the method as quickly as possible.

If an exception is raised it will be returned to the caller as an RPC fault.

call - The method call to be handled.
rspChannel - A handle to a logic channel that can be used when a response is ready.
context - An RpcCallContext instance providing information about the call context.
java.lang.Exception - Implementations are permitted to raise an exception as part of their processing.