|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.flat502.rox.marshal.UnmarshallerAid com.flat502.rox.marshal.MethodCallUnmarshallerAid com.flat502.rox.demo.RMIAsyncServerDemo
public class RMIAsyncServerDemo
A demo server illustrating the ProxyingRequestHandler
class.
Constructor Summary | |
---|---|
RMIAsyncServerDemo()
|
Method Summary | |
---|---|
java.util.Date |
getDate()
Get the current date and time. |
FieldNameCodec |
getFieldNameCodec(java.lang.String methodName)
Invoked when a method call unmarshaller is required. |
java.lang.Class |
getType(java.lang.String methodName,
int index)
An implementation should return a Class instance representing
the type a complex parameter value (a struct or an array) at the given
index should be unmarshalled as. |
java.lang.String |
getVersionInfo(boolean verbose)
Fetch a version string. |
void |
handleRequest(RpcCall call,
RpcCallContext context,
ResponseChannel rspChannel)
Invoked to handle a method call. |
static void |
main(java.lang.String[] args)
Start an instance of this demo server. |
int |
sum(int[] list)
Sums an array of integers; |
Methods inherited from class com.flat502.rox.marshal.UnmarshallerAid |
---|
ignoreMissingFields |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RMIAsyncServerDemo()
Method Detail |
---|
public void handleRequest(RpcCall call, RpcCallContext context, ResponseChannel rspChannel) throws java.lang.Exception
AsynchronousRequestHandler
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.
handleRequest
in interface AsynchronousRequestHandler
call
- The method call to be handled.context
- An RpcCallContext
instance providing information about
the call context.rspChannel
- A handle to a logic channel that can be used
when a response is ready.
java.lang.Exception
- Implementations are permitted to raise
an exception as part of their processing.public java.lang.Class getType(java.lang.String methodName, int index)
MethodCallUnmarshallerAid
Class
instance representing
the type a complex parameter value (a struct or an array) at the given
index should be unmarshalled as.
A null return value will result in the parameter value being unmarshalled
into a Map
instance if, and only if, the parameter value
is an XML-RPC struct and a List
instance if, and only if,
the value is an XML-RPC array.
The returned Class
must be accessible, instantiable, and have an
accessible default constructor.
getType
in class MethodCallUnmarshallerAid
methodName
- The name of the XML-RPC method call being unmarshalled.index
- The index of the parameter value being unmarshalled.
Class
for the type the parameter value should
be unmarshalled as, assuming it is a struct or an array.public FieldNameCodec getFieldNameCodec(java.lang.String methodName)
UnmarshallerAid
This method allows request handlers to override the default unmarshaller implementation for a given method (or class of methods) without imposing that unmarshaller on all request handlers.
Implementations may return the same instance for multiple calls to this method as long as the unmarshaller is thread-safe.
Implementations may return null
in which
case a default unmarshalling implementation will be used.
getFieldNameCodec
in class UnmarshallerAid
methodName
- The name of the XML-RPC method call being unmarshalled.
MethodCallUnmarshaller
instance or
null
.public int sum(int[] list)
sum
in interface RMIServerInterface
list
- The list of integers
public java.lang.String getVersionInfo(boolean verbose)
getVersionInfo
in interface RMIServerInterface
verbose
- A flag indicating whether or not the returned
version info is verbose.
public java.util.Date getDate()
getDate
in interface RMIServerInterface
Date
instance set to
the current date and time.public static void main(java.lang.String[] args)
The following XML-RPC methods are supported by this server:
args
- A list of parameters indicating
the host/address
and
port
to bind to. These default to
localhost
and 8080
if
not specified.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |