public class

SimpleAspectInstanceFactory

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

Class Overview

Implementation of AspectInstanceFactory that creates a new instance of the specified aspect class for every getAspectInstance() call.

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.Ordered
Public Constructors
SimpleAspectInstanceFactory(Class aspectClass)
Create a new SimpleAspectInstanceFactory for the given aspect class.
Public Methods
final Class getAspectClass()
Return the specified aspect class (never null).
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 SimpleAspectInstanceFactory (Class aspectClass)

Create a new SimpleAspectInstanceFactory for the given aspect class.

Parameters
aspectClass the aspect class

Public Methods

public final Class getAspectClass ()

Return the specified aspect class (never null).

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