类 AbstractBeanFactoryPointcutAdvisor
- java.lang.Object
- org.springframework.aop.support.AbstractPointcutAdvisor
- org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
- 所有已实现的接口:
Serializable
,Advisor
,PointcutAdvisor
,Aware
,BeanFactoryAware
,Ordered
- 直接已知子类:
BeanFactoryCacheOperationSourceAdvisor
,BeanFactoryJCacheOperationSourceAdvisor
,BeanFactoryTransactionAttributeSourceAdvisor
,DefaultBeanFactoryPointcutAdvisor
public abstract class AbstractBeanFactoryPointcutAdvisor extends AbstractPointcutAdvisor implements BeanFactoryAware
Abstract BeanFactory-based PointcutAdvisor that allows for any Advice to be configured as reference to an Advice bean in a BeanFactory.Specifying the name of an advice bean instead of the advice object itself (if running within a BeanFactory) increases loose coupling at initialization time, in order to not initialize the advice object until the pointcut actually matches.
- 从以下版本开始:
- 2.0.2
- 作者:
- Juergen Hoeller
- 另请参阅:
setAdviceBeanName(java.lang.String)
,DefaultBeanFactoryPointcutAdvisor
, 序列化表格
字段概要
从接口继承的字段 org.springframework.aop.Advisor
EMPTY_ADVICE
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 AbstractBeanFactoryPointcutAdvisor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Advice
getAdvice()
Return the advice part of this aspect.String
getAdviceBeanName()
Return the name of the advice bean that this advisor refers to, if any.void
setAdvice(Advice advice)
Specify a particular instance of the target advice directly, avoiding lazy resolution ingetAdvice()
.void
setAdviceBeanName(String adviceBeanName)
Specify the name of the advice bean that this advisor should refer to.void
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.String
toString()
从类继承的方法 org.springframework.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance, setOrder
从接口继承的方法 org.springframework.aop.PointcutAdvisor
getPointcut
构造器详细资料
AbstractBeanFactoryPointcutAdvisor
public AbstractBeanFactoryPointcutAdvisor()
方法详细资料
setAdviceBeanName
public void setAdviceBeanName(@Nullable String adviceBeanName)
Specify the name of the advice bean that this advisor should refer to.An instance of the specified bean will be obtained on first access of this advisor's advice. This advisor will only ever obtain at most one single instance of the advice bean, caching the instance for the lifetime of the advisor.
- 另请参阅:
getAdvice()
getAdviceBeanName
@Nullable public String getAdviceBeanName()
Return the name of the advice bean that this advisor refers to, if any.
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
从接口复制的说明:BeanFactoryAware
Callback that supplies the owning factory to a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method.- 指定者:
setBeanFactory
在接口中BeanFactoryAware
- 参数:
beanFactory
- owning BeanFactory (nevernull
). The bean can immediately call methods on the factory.- 另请参阅:
BeanInitializationException
setAdvice
public void setAdvice(Advice advice)
Specify a particular instance of the target advice directly, avoiding lazy resolution ingetAdvice()
.- 从以下版本开始:
- 3.1
getAdvice
public Advice getAdvice()
从接口复制的说明:Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.- 指定者:
getAdvice
在接口中Advisor
- 返回:
- the advice that should apply if the pointcut matches
- 另请参阅:
MethodInterceptor
,BeforeAdvice
,ThrowsAdvice
,AfterReturningAdvice