public class BeanFactoryAspectInstanceFactory extends java.lang.Object implements MetadataAwareAspectInstanceFactory, java.io.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.
BeanFactory,
LazySingletonAspectInstanceFactoryDecorator,
Serialized FormHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
BeanFactoryAspectInstanceFactory(BeanFactory beanFactory,
java.lang.String name)
Create a BeanFactoryAspectInstanceFactory.
|
BeanFactoryAspectInstanceFactory(BeanFactory beanFactory,
java.lang.String name,
java.lang.Class<?> type)
Create a BeanFactoryAspectInstanceFactory, providing a type that AspectJ should
introspect to create AJType metadata.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.ClassLoader |
getAspectClassLoader()
Expose the aspect class loader that this factory uses.
|
java.lang.Object |
getAspectCreationMutex()
Return the best possible creation mutex for this factory.
|
java.lang.Object |
getAspectInstance()
Create an instance of this factory's aspect.
|
AspectMetadata |
getAspectMetadata()
Return the AspectJ AspectMetadata for this factory's aspect.
|
int |
getOrder()
|
java.lang.String |
toString() |
public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, java.lang.String name)
beanFactory - BeanFactory to obtain instance(s) fromname - name of the beanpublic BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, java.lang.String name, @Nullable java.lang.Class<?> type)
beanFactory - BeanFactory to obtain instance(s) fromname - the name of the beantype - the type that should be introspected by AspectJ
(null indicates resolution through BeanFactory.getType(java.lang.String) via the bean name)public java.lang.Object getAspectInstance()
AspectInstanceFactorygetAspectInstance in interface AspectInstanceFactorynull)@Nullable public java.lang.ClassLoader getAspectClassLoader()
AspectInstanceFactorygetAspectClassLoader in interface AspectInstanceFactorynull for the bootstrap loader)ClassUtils.getDefaultClassLoader()public AspectMetadata getAspectMetadata()
MetadataAwareAspectInstanceFactorygetAspectMetadata in interface MetadataAwareAspectInstanceFactory@Nullable public java.lang.Object getAspectCreationMutex()
MetadataAwareAspectInstanceFactorygetAspectCreationMutex in interface MetadataAwareAspectInstanceFactorynull for no mutex to use)public int getOrder()
public java.lang.String toString()
toString in class java.lang.Object