Class BeanFactoryAspectInstanceFactory
java.lang.Object
org.springframework.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
- All Implemented Interfaces:
- Serializable,- MetadataAwareAspectInstanceFactory,- AspectInstanceFactory,- Ordered
- Direct Known Subclasses:
- PrototypeAspectInstanceFactory
public class BeanFactoryAspectInstanceFactory
extends Object
implements MetadataAwareAspectInstanceFactory, Serializable
AspectInstanceFactory implementation
 backed by a Spring BeanFactory.
 Note that this may instantiate multiple times if using a prototype,
 which probably won't give the semantics you expect.
 Use a LazySingletonAspectInstanceFactoryDecorator
 to wrap this to ensure only one new aspect comes back.
- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionBeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name) Create a BeanFactoryAspectInstanceFactory.BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name, Class<?> type) Create a BeanFactoryAspectInstanceFactory, providing a type that AspectJ should introspect to create AJType metadata.
- 
Method Summary
- 
Constructor Details- 
BeanFactoryAspectInstanceFactoryCreate a BeanFactoryAspectInstanceFactory. AspectJ will be called to introspect to create AJType metadata using the type returned for the given bean name from the BeanFactory.- Parameters:
- beanFactory- the BeanFactory to obtain instance(s) from
- name- the name of the bean
 
- 
BeanFactoryAspectInstanceFactorypublic BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name, @Nullable Class<?> type) Create a BeanFactoryAspectInstanceFactory, providing a type that AspectJ should introspect to create AJType metadata. Use if the BeanFactory may consider the type to be a subclass (as when using CGLIB), and the information should relate to a superclass.- Parameters:
- beanFactory- the BeanFactory to obtain instance(s) from
- name- the name of the bean
- type- the type that should be introspected by AspectJ (- nullindicates resolution through- BeanFactory.getType(java.lang.String)via the bean name)
 
 
- 
- 
Method Details- 
getAspectInstanceDescription copied from interface:AspectInstanceFactoryCreate an instance of this factory's aspect.- Specified by:
- getAspectInstancein interface- AspectInstanceFactory
- Returns:
- the aspect instance (never null)
 
- 
getAspectClassLoaderDescription copied from interface:AspectInstanceFactoryExpose the aspect class loader that this factory uses.- Specified by:
- getAspectClassLoaderin interface- AspectInstanceFactory
- Returns:
- the aspect class loader (or nullfor the bootstrap loader)
- See Also:
 
- 
getAspectMetadataDescription copied from interface:MetadataAwareAspectInstanceFactoryGet the AspectJ AspectMetadata for this factory's aspect.- Specified by:
- getAspectMetadatain interface- MetadataAwareAspectInstanceFactory
- Returns:
- the aspect metadata
 
- 
getAspectCreationMutexDescription copied from interface:MetadataAwareAspectInstanceFactoryGet the best possible creation mutex for this factory.- Specified by:
- getAspectCreationMutexin interface- MetadataAwareAspectInstanceFactory
- Returns:
- the mutex object (may be nullfor no mutex to use)
 
- 
getOrderpublic int getOrder()
- 
toString
 
-