org.springframework.aop.interceptor

## 类 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 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.

  作者:
    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 particular `MethodInvocation`.
    `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`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### 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 particular `MethodInvocation`. If not, the method invocation proceeds as normal, otherwise the method invocation is passed to the `invokeUnderTrace` method for handling.
      指定者:
        `invoke` 在接口中 `MethodInterceptor`
      覆盖:
        `invoke` 在类中 `AbstractTraceInterceptor`
      参数:
        `invocation` - 主要实现类:ReflectiveMethodInvocation
      抛出:
        `Throwable`
      另请参阅:
        `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.