marquee.xmlrpc.processors
Class DebugInvocationProcessor

java.lang.Object
  extended bymarquee.xmlrpc.processors.DebugInvocationProcessor
All Implemented Interfaces:
XmlRpcInvocationProcessor

public class DebugInvocationProcessor
extends java.lang.Object
implements XmlRpcInvocationProcessor

Simple invocation processor that traces the calls made through an XmlRpcServer. This is used for debugging purposes only. This may be replaced with a more competent logging processor that perhaps is only logging exceptions that occur.

Since:
JDK 1.1
Version:
$Revision: 1.5 $
Author:
Greger Ohlson (greger.ohlson@marquee.se)

Constructor Summary
DebugInvocationProcessor()
           
 
Method Summary
 void onException(int callId, java.lang.String callerIp, java.lang.String handler, java.lang.String method, java.util.List arguments, java.lang.Throwable exception)
          Prints trace info on the method, its arguments, and the exception it threw.
 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)
          Prints trace info on the method, its arguments, and its return value.
 boolean preProcess(int callId, java.lang.String callerIp, java.lang.String handler, java.lang.String method, java.util.List arguments)
          Does nothing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugInvocationProcessor

public DebugInvocationProcessor()
Method Detail

preProcess

public boolean preProcess(int callId,
                          java.lang.String callerIp,
                          java.lang.String handler,
                          java.lang.String method,
                          java.util.List arguments)
Does nothing.

Specified by:
preProcess in interface XmlRpcInvocationProcessor
Parameters:
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.
Returns:
true if the invocation should proceed, or false if not.

postProcess

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)
Prints trace info on the method, its arguments, and its return value.

Specified by:
postProcess in interface XmlRpcInvocationProcessor
Parameters:
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.
Returns:
The (possibly modified) returnValue argument.

onException

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)
Prints trace info on the method, its arguments, and the exception it threw.

Specified by:
onException in interface XmlRpcInvocationProcessor
Parameters:
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.