Class LazySingletonAspectInstanceFactoryDecorator
java.lang.Object
org.springframework.aop.aspectj.annotation.LazySingletonAspectInstanceFactoryDecorator
- All Implemented Interfaces:
Serializable
,MetadataAwareAspectInstanceFactory
,AspectInstanceFactory
,org.springframework.core.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:
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionCreate a new lazily initializing decorator for the given AspectInstanceFactory. -
Method Summary
-
Constructor Details
-
LazySingletonAspectInstanceFactoryDecorator
Create a new lazily initializing decorator for the given AspectInstanceFactory.- Parameters:
maaif
- the MetadataAwareAspectInstanceFactory to decorate
-
-
Method Details
-
getAspectInstance
Description copied from interface:AspectInstanceFactory
Create an instance of this factory's aspect.- Specified by:
getAspectInstance
in interfaceAspectInstanceFactory
- Returns:
- the aspect instance (never
null
)
-
isMaterialized
public boolean isMaterialized() -
getAspectClassLoader
Description copied from interface:AspectInstanceFactory
Expose the aspect class loader that this factory uses.- Specified by:
getAspectClassLoader
in interfaceAspectInstanceFactory
- Returns:
- the aspect class loader (or
null
for the bootstrap loader) - See Also:
-
ClassUtils.getDefaultClassLoader()
-
getAspectMetadata
Description copied from interface:MetadataAwareAspectInstanceFactory
Get the AspectJ AspectMetadata for this factory's aspect.- Specified by:
getAspectMetadata
in interfaceMetadataAwareAspectInstanceFactory
- Returns:
- the aspect metadata
-
getAspectCreationMutex
Description copied from interface:MetadataAwareAspectInstanceFactory
Get 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)
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
toString
-