Top Description Fields Constructors Methods
org.springframework.aop.aspectj

public Class SingletonAspectInstanceFactory

extends Object
implements AspectInstanceFactory, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.springframework.aop.aspectj.AspectInstanceFactory, org.springframework.core.Ordered
Known Direct Subclasses
org.springframework.aop.aspectj.annotation.SingletonMetadataAwareAspectInstanceFactory
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, org.springframework.core.Ordered, org.springframework.lang.Nullable, org.springframework.util.Assert

Implementation of AspectInstanceFactory that is backed by a specified singleton object, returning the same instance for every getAspectInstance() call.
Authors
Rod Johnson, Juergen Hoeller
Since
2.0
See Also
SimpleAspectInstanceFactory

Field Summary

Modifier and TypeField and Description
private final Object

Constructor Summary

AccessConstructor and Description
public
SingletonAspectInstanceFactory(Object
the singleton aspect instance
aspectInstance
)

Create a new SingletonAspectInstanceFactory for the given aspect instance.

Method Summary

Modifier and TypeMethod and Description
public ClassLoader
getAspectClassLoader()

Implements org.springframework.aop.aspectj.AspectInstanceFactory.getAspectClassLoader.

Expose the aspect class loader that this factory uses.

public final Object
getAspectInstance()

Implements org.springframework.aop.aspectj.AspectInstanceFactory.getAspectInstance.

Create an instance of this factory's aspect.

public int
getOrder()

Implements org.springframework.core.Ordered.getOrder.

Determine the order for this factory's aspect instance, either an instance-specific order expressed through implementing the org.springframework.core.Ordered interface, or a fallback order.

protected int
getOrderForAspectClass(Class<?>
the aspect class
aspectClass
)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aspectInstanceback to summary
private final Object aspectInstance

Constructor Detail

SingletonAspectInstanceFactoryback to summary
public SingletonAspectInstanceFactory(Object aspectInstance)

Create a new SingletonAspectInstanceFactory for the given aspect instance.

Parameters
aspectInstance:Object

the singleton aspect instance

Method Detail

getAspectClassLoaderback to summary
public ClassLoader getAspectClassLoader()

Implements org.springframework.aop.aspectj.AspectInstanceFactory.getAspectClassLoader.

Doc from org.springframework.aop.aspectj.AspectInstanceFactory.getAspectClassLoader.

Expose the aspect class loader that this factory uses.

Returns:ClassLoader

the aspect class loader (or null for the bootstrap loader)

Annotations
@Override
@Nullable
getAspectInstanceback to summary
public final Object getAspectInstance()

Implements org.springframework.aop.aspectj.AspectInstanceFactory.getAspectInstance.

Doc from org.springframework.aop.aspectj.AspectInstanceFactory.getAspectInstance.

Create an instance of this factory's aspect.

Returns:Object

the aspect instance (never null)

Annotations
@Override
getOrderback to summary
public int getOrder()

Implements org.springframework.core.Ordered.getOrder.

Determine the order for this factory's aspect instance, either an instance-specific order expressed through implementing the org.springframework.core.Ordered interface, or a fallback order.

Returns:int

Doc from org.springframework.core.Ordered.getOrder.

the order value

Annotations
@Override
See Also
org.springframework.core.Ordered, getOrderForAspectClass
getOrderForAspectClassback to summary
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 org.springframework.core.Ordered interface.

The default implementation simply returns Ordered.LOWEST_PRECEDENCE.

Parameters
aspectClass:Class<?>

the aspect class