org.springframework.aop.aspectj.annotation

## Class LazySingletonAspectInstanceFactoryDecorator

- java.lang.Object
- - org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator

- All Implemented Interfaces:
    Serializable, MetadataAwareAspectInstanceFactory, AspectInstanceFactory, Ordered

      public class LazySingletonAspectInstanceFactoryDecorator
      extends Object
      implements MetadataAwareAspectInstanceFactory, Serializable

  Decorator to cause a `MetadataAwareAspectInstanceFactory` to instantiate only once.
  Since:
    2.0
  Author:
    Rod Johnson, Juergen Hoeller
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from interface org.springframework.core.Ordered

      `HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LazySingletonAspectInstanceFactoryDecorator(MetadataAwareAspectInstanceFactory maaif)` Create a new lazily initializing decorator for the given AspectInstanceFactory.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClassLoader` | `getAspectClassLoader()` Expose the aspect class loader that this factory uses.
    `Object` | `getAspectCreationMutex()` Get the best possible creation mutex for this factory.
    `Object` | `getAspectInstance()` Create an instance of this factory's aspect.
    `AspectMetadata` | `getAspectMetadata()` Get the AspectJ AspectMetadata for this factory's aspect.
    `int` | `getOrder()` Get the order value of this object.
    `boolean` | `isMaterialized()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### LazySingletonAspectInstanceFactoryDecorator

          public LazySingletonAspectInstanceFactoryDecorator(MetadataAwareAspectInstanceFactory maaif)

      Create a new lazily initializing decorator for the given AspectInstanceFactory.
      Parameters:
        `maaif` - the MetadataAwareAspectInstanceFactory to decorate

  - ### Method Detail

    - #### getAspectInstance

          public Object getAspectInstance()

      Description copied from interface: `AspectInstanceFactory`
      Create an instance of this factory's aspect.
      Specified by:
        `getAspectInstance` in interface `AspectInstanceFactory`
      Returns:
        the aspect instance (never `null`)

    - #### isMaterialized

          public boolean isMaterialized()

    - #### getAspectClassLoader

          @Nullable
          public ClassLoader getAspectClassLoader()

      Description copied from interface: `AspectInstanceFactory`
      Expose the aspect class loader that this factory uses.
      Specified by:
        `getAspectClassLoader` in interface `AspectInstanceFactory`
      Returns:
        the aspect class loader (or `null` for the bootstrap loader)
      See Also:
        `ClassUtils.getDefaultClassLoader()`

    - #### getAspectMetadata

          public AspectMetadata getAspectMetadata()

      Description copied from interface: `MetadataAwareAspectInstanceFactory`
      Get the AspectJ AspectMetadata for this factory's aspect.
      Specified by:
        `getAspectMetadata` in interface `MetadataAwareAspectInstanceFactory`
      Returns:
        the aspect metadata

    - #### getAspectCreationMutex

          @Nullable
          public Object getAspectCreationMutex()

      Description copied from interface: `MetadataAwareAspectInstanceFactory`
      Get the best possible creation mutex for this factory.
      Specified by:
        `getAspectCreationMutex` in interface `MetadataAwareAspectInstanceFactory`
      Returns:
        the mutex object (may be `null` for no mutex to use)

    - #### getOrder

          public int getOrder()

      Description copied from interface: `Ordered`
      Get the order value of this object.

      Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet `load-on-startup` values).

      Same order values will result in arbitrary sort positions for the affected objects.

      Specified by:
        `getOrder` in interface `Ordered`
      Returns:
        the order value
      See Also:
        `Ordered.HIGHEST_PRECEDENCE`, `Ordered.LOWEST_PRECEDENCE`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`