Class SimpleMetadataAwareAspectInstanceFactory
- java.lang.Object
- org.springframework.aop.aspectj.SimpleAspectInstanceFactory
- org.springframework.aop.aspectj.annotation.SimpleMetadataAwareAspectInstanceFactory
- All Implemented Interfaces:
MetadataAwareAspectInstanceFactory
,AspectInstanceFactory
,Ordered
public class SimpleMetadataAwareAspectInstanceFactory extends SimpleAspectInstanceFactory implements MetadataAwareAspectInstanceFactory
Implementation ofMetadataAwareAspectInstanceFactory
that creates a new instance of the specified aspect class for everySimpleAspectInstanceFactory.getAspectInstance()
call.- Since:
- 2.0.4
- Author:
- Juergen Hoeller
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
Constructors Constructor Description SimpleMetadataAwareAspectInstanceFactory(Class<?> aspectClass, String aspectName)
Create a new SimpleMetadataAwareAspectInstanceFactory for the given aspect class.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getAspectCreationMutex()
Return the best possible creation mutex for this factory.AspectMetadata
getAspectMetadata()
Return the AspectJ AspectMetadata for this factory's aspect.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 theOrdered
interface.Methods inherited from class org.springframework.aop.aspectj.SimpleAspectInstanceFactory
getAspectClass, getAspectClassLoader, getAspectInstance, getOrder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.aop.aspectj.AspectInstanceFactory
getAspectClassLoader, getAspectInstance
Constructor Detail
SimpleMetadataAwareAspectInstanceFactory
public SimpleMetadataAwareAspectInstanceFactory(Class<?> aspectClass, String aspectName)
Create a new SimpleMetadataAwareAspectInstanceFactory for the given aspect class.- Parameters:
aspectClass
- the aspect classaspectName
- the aspect name
Method Detail
getAspectMetadata
public final AspectMetadata getAspectMetadata()
Description copied from interface:MetadataAwareAspectInstanceFactory
Return the AspectJ AspectMetadata for this factory's aspect.- Specified by:
getAspectMetadata
in interfaceMetadataAwareAspectInstanceFactory
- Returns:
- the aspect metadata
getAspectCreationMutex
public Object getAspectCreationMutex()
Description copied from interface:MetadataAwareAspectInstanceFactory
Return the best possible creation mutex for this factory.- Specified by:
getAspectCreationMutex
in interfaceMetadataAwareAspectInstanceFactory
- Returns:
- the mutex object (may be
null
for no mutex to use)
getOrderForAspectClass
protected int getOrderForAspectClass(Class<?> aspectClass)
Description copied from class:SimpleAspectInstanceFactory
Determine a fallback order for the case that the aspect instance does not express an instance-specific order through implementing theOrdered
interface.The default implementation simply returns
Ordered.LOWEST_PRECEDENCE
.- Overrides:
getOrderForAspectClass
in classSimpleAspectInstanceFactory
- Parameters:
aspectClass
- the aspect class