|
||||||||||
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.server.ProxyingRequestHandler
public abstract class ProxyingRequestHandler
A SynchronousRequestHandler
implementation
that maps RPC method calls onto methods on an arbitrary
object using reflection.
Sub-classes provide the concrete instance of
RpcMethodProxy
and the
rest is handled by delegating appropriately to that instance.
Constructor Summary | |
---|---|
ProxyingRequestHandler(RpcMethodProxy proxy)
|
Method Summary | |
---|---|
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. |
RpcResponse |
handleRequest(RpcCall call)
Deprecated. Override handleRequest(RpcCall, RpcCallContext) instead. |
RpcResponse |
handleRequest(RpcCall call,
RpcCallContext context)
Invoked to handle a method call. |
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 ProxyingRequestHandler(RpcMethodProxy proxy)
Method Detail |
---|
public RpcResponse handleRequest(RpcCall call) throws java.lang.Exception
handleRequest(RpcCall, RpcCallContext)
instead.
java.lang.Exception
public RpcResponse handleRequest(RpcCall call, RpcCallContext context) throws java.lang.Exception
SynchronousRequestHandler
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.
handleRequest
in interface SynchronousRequestHandler
call
- The method call to be handled.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.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.
null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |