|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.aop.interceptor.AbstractTraceInterceptor org.springframework.aop.interceptor.SimpleTraceInterceptor org.springframework.aop.interceptor.DebugInterceptor
public class DebugInterceptor
AOP Alliance MethodInterceptor
that can be introduced in a chain
to display verbose information about intercepted invocations to the logger.
Logs full invocation details on method entry and method exit,
including invocation arguments and invocation count. This is only
intended for debugging purposes; use SimpleTraceInterceptor
or CustomizableTraceInterceptor
for pure tracing purposes.
SimpleTraceInterceptor
,
CustomizableTraceInterceptor
,
Serialized FormField Summary |
---|
Fields inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor |
---|
defaultLogger |
Constructor Summary | |
---|---|
DebugInterceptor()
Create a new DebugInterceptor with a static logger. |
|
DebugInterceptor(boolean useDynamicLogger)
Create a new DebugInterceptor with dynamic or static logger, according to the given flag. |
Method Summary | |
---|---|
long |
getCount()
Return the number of times this interceptor has been invoked. |
protected String |
getInvocationDescription(MethodInvocation invocation)
Return a description for the given method invocation. |
Object |
invoke(MethodInvocation invocation)
Determines whether or not logging is enabled for the particular MethodInvocation . |
void |
resetCount()
Reset the invocation count to zero. |
Methods inherited from class org.springframework.aop.interceptor.SimpleTraceInterceptor |
---|
invokeUnderTrace |
Methods inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptor |
---|
getLoggerForInvocation, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLoggerName, setUseDynamicLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DebugInterceptor()
public DebugInterceptor(boolean useDynamicLogger)
useDynamicLogger
- whether to use a dynamic logger or a static loggerAbstractTraceInterceptor.setUseDynamicLogger(boolean)
Method Detail |
---|
public Object invoke(MethodInvocation invocation) throws Throwable
AbstractTraceInterceptor
MethodInvocation
.
If not, the method invocation proceeds as normal, otherwise the method invocation is passed
to the invokeUnderTrace
method for handling.
invoke
in interface MethodInterceptor
invoke
in class AbstractTraceInterceptor
Throwable
AbstractTraceInterceptor.invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log)
protected String getInvocationDescription(MethodInvocation invocation)
SimpleTraceInterceptor
getInvocationDescription
in class SimpleTraceInterceptor
invocation
- the invocation to describe
public long getCount()
public void resetCount()
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |