类 BeanFactoryAspectInstanceFactory
java.lang.Object
infra.aop.aspectj.annotation.BeanFactoryAspectInstanceFactory
- 所有已实现的接口:
MetadataAwareAspectInstanceFactory,AspectInstanceFactory,infra.core.Ordered,Serializable
- 直接已知子类:
PrototypeAspectInstanceFactory
public class BeanFactoryAspectInstanceFactory
extends Object
implements MetadataAwareAspectInstanceFactory, Serializable
AspectInstanceFactory implementation
backed by a Framework 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.
- 从以下版本开始:
- 4.0
- 作者:
- Rod Johnson, Juergen Hoeller, Harry Yang
- 另请参阅:
-
BeanFactoryLazySingletonAspectInstanceFactoryDecorator- 序列化表格
-
字段概要
字段修饰符和类型字段说明private final AspectMetadataprivate final infra.beans.factory.BeanFactoryprivate final String从接口继承的字段 infra.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器构造器说明BeanFactoryAspectInstanceFactory(infra.beans.factory.BeanFactory beanFactory, String name) Create a BeanFactoryAspectInstanceFactory.BeanFactoryAspectInstanceFactory(infra.beans.factory.BeanFactory beanFactory, String name, Class<?> type) Create a BeanFactoryAspectInstanceFactory, providing a type that AspectJ should introspect to create AJType metadata. -
方法概要
修饰符和类型方法说明Expose the aspect class loader that this factory uses.Return the best possible creation mutex for this factory.Create an instance of this factory's aspect.Return the AspectJ AspectMetadata for this factory's aspect.intgetOrder()Determine the order for this factory's target aspect, either an instance-specific order expressed through implementing theOrderedinterface (only checked for singleton beans), or an order expressed through theOrderannotation at the class level.toString()
-
字段详细资料
-
beanFactory
private final infra.beans.factory.BeanFactory beanFactory -
name
-
aspectMetadata
-
-
构造器详细资料
-
BeanFactoryAspectInstanceFactory
Create a BeanFactoryAspectInstanceFactory. AspectJ will be called to introspect to create AJType metadata using the type returned for the given bean name from the BeanFactory.- 参数:
beanFactory- the BeanFactory to obtain instance(s) fromname- the name of the bean
-
BeanFactoryAspectInstanceFactory
public BeanFactoryAspectInstanceFactory(infra.beans.factory.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.- 参数:
beanFactory- the BeanFactory to obtain instance(s) fromname- the name of the beantype- the type that should be introspected by AspectJ (nullindicates resolution throughBeanFactory.getType(java.lang.String)via the bean name)
-
-
方法详细资料
-
getAspectInstance
从接口复制的说明:AspectInstanceFactoryCreate an instance of this factory's aspect.- 指定者:
getAspectInstance在接口中AspectInstanceFactory- 返回:
- the aspect instance (never
null)
-
getAspectClassLoader
从接口复制的说明:AspectInstanceFactoryExpose the aspect class loader that this factory uses.- 指定者:
getAspectClassLoader在接口中AspectInstanceFactory- 返回:
- the aspect class loader (or
nullfor the bootstrap loader) - 另请参阅:
-
ClassUtils.getDefaultClassLoader()
-
getAspectMetadata
从接口复制的说明:MetadataAwareAspectInstanceFactoryReturn the AspectJ AspectMetadata for this factory's aspect.- 指定者:
getAspectMetadata在接口中MetadataAwareAspectInstanceFactory- 返回:
- the aspect metadata
-
getAspectCreationMutex
从接口复制的说明:MetadataAwareAspectInstanceFactoryReturn the best possible creation mutex for this factory.- 指定者:
getAspectCreationMutex在接口中MetadataAwareAspectInstanceFactory- 返回:
- the mutex object (may be
nullfor no mutex to use)
-
getOrder
public int getOrder()Determine the order for this factory's target aspect, either an instance-specific order expressed through implementing theOrderedinterface (only checked for singleton beans), or an order expressed through theOrderannotation at the class level.- 指定者:
getOrder在接口中infra.core.Ordered- 另请参阅:
-
OrderedOrder
-
toString
-