org.springframework.aop.interceptor

## 类 AbstractMonitoringInterceptor

- java.lang.Object
- - org.springframework.aop.interceptor.AbstractTraceInterceptor
  - - org.springframework.aop.interceptor.AbstractMonitoringInterceptor

- 所有已实现的接口:
    Serializable, Advice, Interceptor, MethodInterceptor
  直接已知子类:
    JamonPerformanceMonitorInterceptor, PerformanceMonitorInterceptor

      public abstract class AbstractMonitoringInterceptor
      extends AbstractTraceInterceptor

  Base class for monitoring interceptors, such as performance monitors. Provides configurable "prefix and "suffix" properties that help to classify/group performance monitoring results.

  In their `AbstractTraceInterceptor.invokeUnderTrace(org.aopalliance.intercept.MethodInvocation, org.apache.commons.logging.Log)` implementation, subclasses should call the `createInvocationTraceName(org.aopalliance.intercept.MethodInvocation)` method to create a name for the given trace, including information about the method invocation along with a prefix/suffix.

  从以下版本开始:
    1.2.7
  作者:
    Rob Harrop, Juergen Hoeller
  另请参阅:
    `setPrefix(java.lang.String)`, `setSuffix(java.lang.String)`, `createInvocationTraceName(org.aopalliance.intercept.MethodInvocation)`, 序列化表格

- - ### 字段概要

    - ### 从类继承的字段 org.springframework.aop.interceptor.AbstractTraceInterceptor

      `defaultLogger`

  - ### 构造器概要

    构造器
    构造器和说明
    `AbstractMonitoringInterceptor()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected String` | `createInvocationTraceName(MethodInvocation invocation)` Create a `String` name for the given `MethodInvocation` that can be used for trace/logging purposes.
    `protected String` | `getPrefix()` Return the text that will get appended to the trace data.
    `protected String` | `getSuffix()` Return the text that will get prepended to the trace data.
    `void` | `setLogTargetClassInvocation(boolean logTargetClassInvocation)` Set whether to log the invocation on the target class, if applicable (i.e. if the method is actually delegated to the target class).
    `void` | `setPrefix(String prefix)` Set the text that will get appended to the trace data.
    `void` | `setSuffix(String suffix)` Set the text that will get prepended to the trace data.

    - ### 从类继承的方法 org.springframework.aop.interceptor.AbstractTraceInterceptor

      `getClassForLogging, getLoggerForInvocation, invoke, invokeUnderTrace, isInterceptorEnabled, isLogEnabled, setHideProxyClassNames, setLogExceptionStackTrace, setLoggerName, setUseDynamicLogger, writeToLog, writeToLog`

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

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

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

    - #### AbstractMonitoringInterceptor

          public AbstractMonitoringInterceptor()

  - ### 方法详细资料

    - #### setPrefix

          public void setPrefix(@Nullable
                                String prefix)

      Set the text that will get appended to the trace data.

      Default is none.

    - #### getPrefix

          protected String getPrefix()

      Return the text that will get appended to the trace data.

    - #### setSuffix

          public void setSuffix(@Nullable
                                String suffix)

      Set the text that will get prepended to the trace data.

      Default is none.

    - #### getSuffix

          protected String getSuffix()

      Return the text that will get prepended to the trace data.

    - #### setLogTargetClassInvocation

          public void setLogTargetClassInvocation(boolean logTargetClassInvocation)

      Set whether to log the invocation on the target class, if applicable (i.e. if the method is actually delegated to the target class).

      Default is "false", logging the invocation based on the proxy interface/class name.

    - #### createInvocationTraceName

          protected String createInvocationTraceName(MethodInvocation invocation)

      Create a `String` name for the given `MethodInvocation` that can be used for trace/logging purposes. This name is made up of the configured prefix, followed by the fully-qualified name of the method being invoked, followed by the configured suffix.
      另请参阅:
        `setPrefix(java.lang.String)`, `setSuffix(java.lang.String)`