|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object triptracker.testing.compress.DebugProxy
public class DebugProxy
Generic debug proxy class that logs every method call.
<janmagne at broadpark dot no>
Field Summary | |
---|---|
protected static boolean |
debugEnabled
|
protected List<Method> |
history
|
protected List<Method> |
methods
|
protected Object |
obj
|
Constructor Summary | |
---|---|
protected |
DebugProxy(Object obj)
Creation of new proxies can only be made by the proxyFor(Object) method since the constructor's visibility
is private. |
Method Summary | |
---|---|
void |
clearHistory()
Clear the method call history. |
List<Method> |
getHistory()
Returns the method call history as a list of strings. |
Object |
invoke(Object proxy,
Method method,
Object[] args)
This method is called everytime a call is made to any method on the proxy instance. |
static boolean |
isDebugEnabled()
Get the enabled state of the debug proxy class. |
static Object |
proxyFor(Object obj)
Creates a logging proxy object from the specified object. |
static void |
setDebugEnabled(boolean state)
Set the enabled state of the debug proxy class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Object obj
protected final List<Method> methods
protected final List<Method> history
protected static boolean debugEnabled
Constructor Detail |
---|
protected DebugProxy(Object obj)
proxyFor(Object)
method since the constructor's visibility
is private.
obj
- points to the object to create a proxy for.Method Detail |
---|
public static Object proxyFor(Object obj)
obj
- points to the object to create a proxy for.
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
proxy
- is a reference to the proxy object.method
- points to a method object describing the method being
called.args
- is the arguments for the method call.
Throwable
InvocationHandler.invoke(java.lang.Object,
java.lang.reflect.Method, java.lang.Object[])
public List<Method> getHistory()
public void clearHistory()
public static boolean isDebugEnabled()
If a debug proxy class is disabled its debug specific states shall not
be modified when method invocations pass through the
invoke(Object, Method, Object[])
method and it should not
generate any debug specific output.
public static void setDebugEnabled(boolean state)
If a debug proxy class is disabled its debug specific states shall not
be modified when method invocations pass through the
invoke(Object, Method, Object[])
method and it should not
generate any debug specific output.
state
- is the enabled state of the debug proxy.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |