public abstract class AbstractBeanFactoryPointcutAdvisor extends AbstractPointcutAdvisor implements BeanFactoryAware
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.
setAdviceBeanName(java.lang.String),
DefaultBeanFactoryPointcutAdvisor,
Serialized FormHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
AbstractBeanFactoryPointcutAdvisor() |
| Modifier and Type | Method and Description |
|---|---|
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) |
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() |
equals, getOrder, hashCode, isPerInstance, setOrderclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPointcutpublic void setAdviceBeanName(String adviceBeanName)
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()public String getAdviceBeanName()
public void setBeanFactory(BeanFactory beanFactory)
BeanFactoryAwareInvoked after the population of normal bean properties
but before an initialization callback such as
InitializingBean.afterPropertiesSet() or a custom init-method.
setBeanFactory in interface BeanFactoryAwarebeanFactory - owning BeanFactory (never null).
The bean can immediately call methods on the factory.BeanInitializationExceptionpublic void setAdvice(Advice advice)
public Advice getAdvice()
AdvisorgetAdvice in interface AdvisorMethodInterceptor,
BeforeAdvice,
ThrowsAdvice,
AfterReturningAdvice