public class SessionInvocationProcessor extends java.lang.Object implements XmlRpcInvocationProcessor
Note that the getSession() method is static, so in this form sessions span the whole JVM regardless of how many XmlRpcServers are instantiated. Should not be a problem though.
Constructor and Description |
---|
SessionInvocationProcessor() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map |
getSession()
Returns the session associated with the calling thread.
|
void |
onException(int callId,
java.lang.String callerIp,
java.lang.String handler,
java.lang.String method,
java.util.List arguments,
java.lang.Throwable exception)
Does nothing.
|
java.lang.Object |
postProcess(int callId,
java.lang.String callerIp,
java.lang.String handler,
java.lang.String method,
java.util.List arguments,
java.lang.Object returnValue)
Does nothing.
|
boolean |
preProcess(int callId,
java.lang.String callerIp,
java.lang.String handler,
java.lang.String method,
java.util.List arguments)
Associates the calling thread (the thread handling the invocation) with the IP address
of the client.
|
static void |
setSessionTimeout(int timeout_)
Sets the timout value for sessions, expressed in minutes.
|
public static java.util.Map getSession()
public static void setSessionTimeout(int timeout_)
timeout
- The number of minutes that sessions should remain in memory
before thay expire, supplied in minutes. A value of 0 indicates
that sessions never expire.public boolean preProcess(int callId, java.lang.String callerIp, java.lang.String handler, java.lang.String method, java.util.List arguments)
preProcess
in interface XmlRpcInvocationProcessor
callId
- A sequence number for tracing calls between preProcess() and
postProcess() calls. This is unique within each session. That is,
the sequence is restarted when the application restarts.handler
- The name of the handler being called.method
- The name of the method being called.arguments
- The arguments that will be sent to the method.XmlRpcInvocationProcessor
public java.lang.Object postProcess(int callId, java.lang.String callerIp, java.lang.String handler, java.lang.String method, java.util.List arguments, java.lang.Object returnValue)
postProcess
in interface XmlRpcInvocationProcessor
callId
- A sequence number for tracing calls between preProcess() and
postProcess() calls. This is unique within each session. That is,
the sequence is restarted when the application restarts.handler
- The name of the handler being called.method
- The name of the method that just has returned.returnValue
- The objects returned by the method. If the method
returned a primitive, it is wrapped in its object counterpart.public void onException(int callId, java.lang.String callerIp, java.lang.String handler, java.lang.String method, java.util.List arguments, java.lang.Throwable exception)
onException
in interface XmlRpcInvocationProcessor
callId
- A sequence number for tracing calls between preProcess() and
postProcess() calls. This is unique within each session. That is,
the sequence is restarted when the application restarts.handler
- The name of the handler being called.method
- The name of the method that just has returned by throwing an
exception.exception
- The exception thrown by the method.