public class

SingletonAspectInstanceFactory

extends Object
implements AspectInstanceFactory
java.lang.Object
   ↳ org.springframework.aop.aspectj.SingletonAspectInstanceFactory
Known Direct Subclasses

Class Overview

Implementation of AspectInstanceFactory that is backed by a specified singleton object, returning the same instance for every getAspectInstance() call.

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.Ordered
Public Constructors
SingletonAspectInstanceFactory(Object aspectInstance)
Create a new SingletonAspectInstanceFactory for the given aspect instance.
Public Methods
ClassLoader getAspectClassLoader()
Expose the aspect class loader that this factory uses.
final 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 Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.aop.aspectj.AspectInstanceFactory
From interface org.springframework.core.Ordered

Public Constructors

public SingletonAspectInstanceFactory (Object aspectInstance)

Create a new SingletonAspectInstanceFactory for the given aspect instance.

Parameters
aspectInstance the singleton aspect instance

Public Methods

public ClassLoader getAspectClassLoader ()

Expose the aspect class loader that this factory uses.

Returns
  • the aspect class loader (never null)

public final Object getAspectInstance ()

Create an instance of this factory's aspect.

Returns
  • the aspect instance (never null)

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.

Returns
  • the order value

Protected Methods

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.

Parameters
aspectClass the aspect class