com.flat502.rox.demo
Class SyncServerDemo

java.lang.Object
  extended by com.flat502.rox.demo.SyncServerDemo
All Implemented Interfaces:
RequestHandler, SynchronousRequestHandler

public class SyncServerDemo
extends java.lang.Object
implements SynchronousRequestHandler

A demo synchronous server illustrating the SynchronousRequestHandler interface.


Constructor Summary
SyncServerDemo()
           
 
Method Summary
 RpcResponse handleRequest(RpcCall call, RpcCallContext context)
          Invoked to handle a method call.
static void main(java.lang.String[] args)
          Start an instance of this demo server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncServerDemo

public SyncServerDemo()
Method Detail

handleRequest

public RpcResponse handleRequest(RpcCall call,
                                 RpcCallContext context)
                          throws java.lang.Exception
Description copied from interface: SynchronousRequestHandler
Invoked to handle a method call.

This method is responsible for processing the method synchronously. The return value will be marshalled and sent back to the client immediately.

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

If processing might be length consider using AsynchronousRequestHandler and handing off the work to an application thread.

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

Specified by:
handleRequest in interface SynchronousRequestHandler
Parameters:
call - The method call to be handled.
context - An RpcCallContext instance providing information about the call context.
Returns:
An appropriate RPC response.
Throws:
java.lang.Exception - Implementations are permitted to raise an exception as part of their processing.

main

public static void main(java.lang.String[] args)
Start an instance of this demo server.

The following XML-RPC methods are supported by this server:

Parameters:
args - A list of parameters indicating the host/address and port to bind to. These default to localhost and 8080 if not specified.