类 DebugInterceptor
- java.lang.Object
- org.springframework.aop.interceptor.AbstractTraceInterceptor
- org.springframework.aop.interceptor.SimpleTraceInterceptor
- org.springframework.aop.interceptor.DebugInterceptor
- 所有已实现的接口:
Serializable
,Advice
,Interceptor
,MethodInterceptor
public class DebugInterceptor extends SimpleTraceInterceptor
AOP AllianceMethodInterceptor
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
orCustomizableTraceInterceptor
for pure tracing purposes.- 作者:
- Rod Johnson, Juergen Hoeller
- 另请参阅:
SimpleTraceInterceptor
,CustomizableTraceInterceptor
, 序列化表格
字段概要
从类继承的字段 org.springframework.aop.interceptor.AbstractTraceInterceptor
defaultLogger
构造器概要
构造器 构造器 说明 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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 particularMethodInvocation
.void
resetCount()
Reset the invocation count to zero.从类继承的方法 org.springframework.aop.interceptor.SimpleTraceInterceptor
invokeUnderTrace
从类继承的方法 org.springframework.aop.interceptor.AbstractTraceInterceptor
getClassForLogging, getLoggerForInvocation, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLogExceptionStackTrace, setLoggerName, setUseDynamicLogger, writeToLog, writeToLog
构造器详细资料
DebugInterceptor
public DebugInterceptor()
Create a new DebugInterceptor with a static logger.
DebugInterceptor
public DebugInterceptor(boolean useDynamicLogger)
Create a new DebugInterceptor with dynamic or static logger, according to the given flag.- 参数:
useDynamicLogger
- whether to use a dynamic logger or a static logger- 另请参阅:
AbstractTraceInterceptor.setUseDynamicLogger(boolean)
方法详细资料
invoke
public Object invoke(MethodInvocation invocation) throws Throwable
从类复制的说明:AbstractTraceInterceptor
Determines whether or not logging is enabled for the particularMethodInvocation
. If not, the method invocation proceeds as normal, otherwise the method invocation is passed to theinvokeUnderTrace
method for handling.- 指定者:
invoke
在接口中MethodInterceptor
- 覆盖:
invoke
在类中AbstractTraceInterceptor
- 参数:
invocation
- the method invocation joinpoint- 返回:
- the result of the call to
Joinpoint.proceed()
; might be intercepted by the interceptor - 抛出:
Throwable
- if the interceptors or the target object throws an exception- 另请参阅:
AbstractTraceInterceptor.invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log)
getInvocationDescription
protected String getInvocationDescription(MethodInvocation invocation)
从类复制的说明:SimpleTraceInterceptor
Return a description for the given method invocation.- 覆盖:
getInvocationDescription
在类中SimpleTraceInterceptor
- 参数:
invocation
- the invocation to describe- 返回:
- the description
getCount
public long getCount()
Return the number of times this interceptor has been invoked.
resetCount
public void resetCount()
Reset the invocation count to zero.