org.springframework.aop.interceptor

## 类 ExposeInvocationInterceptor

- java.lang.Object
- - org.springframework.aop.interceptor.ExposeInvocationInterceptor

- 所有已实现的接口:
    Serializable, Advice, Interceptor, MethodInterceptor, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered

      public class ExposeInvocationInterceptor
      extends Object
      implements MethodInterceptor, org.springframework.core.PriorityOrdered, Serializable

  Interceptor that exposes the current `MethodInvocation` as a thread-local object. We occasionally need to do this; for example, when a pointcut (e.g. an AspectJ expression pointcut) needs to know the full invocation context.

  Don't use this interceptor unless this is really necessary. Target objects should not normally know about Spring AOP, as this creates a dependency on Spring API. Target objects should be plain POJOs as far as possible.

  If used, this interceptor will normally be the first in the interceptor chain.

  作者:
    Rod Johnson, Juergen Hoeller
  另请参阅:
    序列化表格

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static Advisor` | `ADVISOR` Singleton advisor for this class.
    `static ExposeInvocationInterceptor` | `INSTANCE` Singleton instance of this class

    - ### 从接口继承的字段 org.springframework.core.Ordered

      `HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

  - ### 方法概要

    所有方法 静态方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static MethodInvocation` | `currentInvocation()` Return the AOP Alliance MethodInvocation object associated with the current invocation.
    `int` | `getOrder()`
    `Object` | `invoke(MethodInvocation mi)` 方法实现说明

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

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

- - ### 字段详细资料

    - #### INSTANCE

          public static final ExposeInvocationInterceptor INSTANCE

      Singleton instance of this class

    - #### ADVISOR

          public static final Advisor ADVISOR

      Singleton advisor for this class. Use in preference to INSTANCE when using Spring AOP, as it prevents the need to create a new Advisor to wrap the instance.

  - ### 方法详细资料

    - #### currentInvocation

          public static MethodInvocation currentInvocation()
                                                    throws IllegalStateException

      Return the AOP Alliance MethodInvocation object associated with the current invocation.
      返回:
        the invocation object associated with the current invocation
      抛出:
        `IllegalStateException` - if there is no AOP invocation in progress, or if the ExposeInvocationInterceptor was not added to this interceptor chain

    - #### invoke

          public Object invoke(MethodInvocation mi)
                        throws Throwable

      从接口复制的说明: `MethodInterceptor`
      方法实现说明
      指定者:
        `invoke` 在接口中 `MethodInterceptor`
      参数:
        `mi` - 主要实现类:ReflectiveMethodInvocation
      抛出:
        `Throwable`

    - #### getOrder

          public int getOrder()

      指定者:
        `getOrder` 在接口中 `org.springframework.core.Ordered`