|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectconsciouscode.util.CallTraceProxy
public class CallTraceProxy
A dynamic proxy that logs all method invocations for debugging purposes.
To trace invocations on a subject, call create(Object, Log)
with
the subject and (optionally) a Log
. The proxy returned implements the
same interfaces as the subject. As long as the proxy's log is not
null
, method invocations (through the proxy) will generate
debug output logging entry and exit, along with any arguments, return
values, and exceptions.
Instances of this class are not serializable, since there are no meaningful semantics for serializing a Log.
Method Summary | |
---|---|
static Class<?>[] |
computeInterfaceClosure(Class<?> type)
|
static Object |
create(Object subject)
Creates a disabled tracing proxy for a given subject. |
static Object |
create(Object subject,
Log log)
Creates a tracing proxy for a given subject. |
Log |
getLog()
Gets the log to which method invocations are being traced. |
Object |
invoke(Object proxy,
Method method,
Object[] args)
|
void |
setLog(Log log)
Sets the log to which method invocations will be traced. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Object create(Object subject)
public static Object create(Object subject, Log log)
public static Class<?>[] computeInterfaceClosure(Class<?> type)
public Log getLog()
public void setLog(Log log)
log
is null
, no tracing will be
performed.
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |