Class DebugInterceptor
java.lang.Object
org.springframework.aop.interceptor.AbstractTraceInterceptor
org.springframework.aop.interceptor.SimpleTraceInterceptor
org.springframework.aop.interceptor.DebugInterceptor
- All Implemented Interfaces:
- Serializable,- Advice,- Interceptor,- MethodInterceptor
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.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptordefaultLogger
- 
Constructor SummaryConstructorsConstructorDescriptionCreate 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 SummaryModifier and TypeMethodDescriptionlonggetCount()Return the number of times this interceptor has been invoked.protected StringgetInvocationDescription(MethodInvocation invocation) Return a description for the given method invocation.invoke(MethodInvocation invocation) Determines whether or not logging is enabled for the particularMethodInvocation.voidReset the invocation count to zero.Methods inherited from class org.springframework.aop.interceptor.SimpleTraceInterceptorinvokeUnderTraceMethods inherited from class org.springframework.aop.interceptor.AbstractTraceInterceptorgetClassForLogging, getLoggerForInvocation, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLogExceptionStackTrace, setLoggerName, setUseDynamicLogger, writeToLog, writeToLog
- 
Constructor Details- 
DebugInterceptorpublic DebugInterceptor()Create a new DebugInterceptor with a static logger.
- 
DebugInterceptorpublic DebugInterceptor(boolean useDynamicLogger) Create a new DebugInterceptor with dynamic or static logger, according to the given flag.- Parameters:
- useDynamicLogger- whether to use a dynamic logger or a static logger
- See Also:
 
 
- 
- 
Method Details- 
invokeDescription copied from class:AbstractTraceInterceptorDetermines whether or not logging is enabled for the particularMethodInvocation. If not, the method invocation proceeds as normal, otherwise the method invocation is passed to theinvokeUnderTracemethod for handling.- Specified by:
- invokein interface- MethodInterceptor
- Overrides:
- invokein class- AbstractTraceInterceptor
- Parameters:
- invocation- the method invocation joinpoint
- Returns:
- the result of the call to Joinpoint.proceed(); might be intercepted by the interceptor
- Throws:
- Throwable- if the interceptors or the target object throws an exception
- See Also:
 
- 
getInvocationDescriptionDescription copied from class:SimpleTraceInterceptorReturn a description for the given method invocation.- Overrides:
- getInvocationDescriptionin class- SimpleTraceInterceptor
- Parameters:
- invocation- the invocation to describe
- Returns:
- the description
 
- 
getCountpublic long getCount()Return the number of times this interceptor has been invoked.
- 
resetCountpublic void resetCount()Reset the invocation count to zero.
 
-