public class BeanFactoryAspectInstanceFactory extends Object implements MetadataAwareAspectInstanceFactory
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,
LazySingletonAspectInstanceFactoryDecoratorHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
BeanFactoryAspectInstanceFactory(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.
|
| Modifier and Type | Method and Description |
|---|---|
ClassLoader |
getAspectClassLoader()
Expose the aspect class loader that this factory uses.
|
Object |
getAspectInstance()
Create an instance of this factory's aspect.
|
AspectMetadata |
getAspectMetadata()
Return the AspectJ AspectMetadata for this factory's aspect.
|
int |
getOrder()
|
String |
toString() |
public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name)
beanFactory - BeanFactory to obtain instance(s) fromname - name of the beanpublic BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name, Class<?> type)
beanFactory - BeanFactory to obtain instance(s) fromname - the name of the beantype - the type that should be introspected by AspectJpublic Object getAspectInstance()
AspectInstanceFactorygetAspectInstance in interface AspectInstanceFactorynull)public ClassLoader getAspectClassLoader()
AspectInstanceFactorygetAspectClassLoader in interface AspectInstanceFactorynull)public AspectMetadata getAspectMetadata()
MetadataAwareAspectInstanceFactorygetAspectMetadata in interface MetadataAwareAspectInstanceFactorypublic int getOrder()