org.springframework.aop.aspectj

## 类 SingletonAspectInstanceFactory

- java.lang.Object
- - org.springframework.aop.aspectj.SingletonAspectInstanceFactory

- 所有已实现的接口:
    Serializable, AspectInstanceFactory, org.springframework.core.Ordered
  直接已知子类:
    SingletonMetadataAwareAspectInstanceFactory

      public class SingletonAspectInstanceFactory
      extends Object
      implements AspectInstanceFactory, Serializable

  Implementation of `AspectInstanceFactory` that is backed by a specified singleton object, returning the same instance for every `getAspectInstance()` call.
  从以下版本开始:
    2.0
  作者:
    Rod Johnson, Juergen Hoeller
  另请参阅:
    `SimpleAspectInstanceFactory`, 序列化表格

- - ### 字段概要

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

      `HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

  - ### 构造器概要

    构造器
    构造器和说明
    `SingletonAspectInstanceFactory(Object aspectInstance)` Create a new SingletonAspectInstanceFactory for the given aspect instance.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `ClassLoader` | `getAspectClassLoader()` Expose the aspect class loader that this factory uses.
    `Object` | `getAspectInstance()` Create an instance of this factory's aspect.
    `int` | `getOrder()` Determine the order for this factory's aspect instance, either an instance-specific order expressed through implementing the `Ordered` interface, or a fallback order.
    `protected int` | `getOrderForAspectClass(Class<?> aspectClass)` Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the `Ordered` interface.

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

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

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

    - #### SingletonAspectInstanceFactory

          public SingletonAspectInstanceFactory(Object aspectInstance)

      Create a new SingletonAspectInstanceFactory for the given aspect instance.
      参数:
        `aspectInstance` - the singleton aspect instance

  - ### 方法详细资料

    - #### getAspectInstance

          public final Object getAspectInstance()

      从接口复制的说明: `AspectInstanceFactory`
      Create an instance of this factory's aspect.
      指定者:
        `getAspectInstance` 在接口中 `AspectInstanceFactory`
      返回:
        the aspect instance (never `null`)

    - #### getAspectClassLoader

          @Nullable
          public ClassLoader getAspectClassLoader()

      从接口复制的说明: `AspectInstanceFactory`
      Expose the aspect class loader that this factory uses.
      指定者:
        `getAspectClassLoader` 在接口中 `AspectInstanceFactory`
      返回:
        the aspect class loader (or `null` for the bootstrap loader)
      另请参阅:
        `ClassUtils.getDefaultClassLoader()`

    - #### getOrder

          public int getOrder()

      Determine the order for this factory's aspect instance, either an instance-specific order expressed through implementing the `Ordered` interface, or a fallback order.
      指定者:
        `getOrder` 在接口中 `org.springframework.core.Ordered`
      另请参阅:
        `Ordered`, `getOrderForAspectClass(java.lang.Class<?>)`

    - #### getOrderForAspectClass

          protected int getOrderForAspectClass(Class<?> aspectClass)

      Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing the `Ordered` interface.

      The default implementation simply returns `Ordered.LOWEST_PRECEDENCE`.

      参数:
        `aspectClass` - the aspect class