Package org.springframework.aop.support
Class AbstractBeanFactoryPointcutAdvisor
java.lang.Object
org.springframework.aop.support.AbstractPointcutAdvisor
org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
- All Implemented Interfaces:
- Serializable,- Advisor,- PointcutAdvisor,- Aware,- BeanFactoryAware,- Ordered
- Direct Known Subclasses:
- 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.
- Since:
- 2.0.2
- Author:
- Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from interface org.springframework.aop.AdvisorEMPTY_ADVICEFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturn the advice part of this aspect.Return the name of the advice bean that this advisor refers to, if any.voidSpecify a particular instance of the target advice directly, avoiding lazy resolution ingetAdvice().voidsetAdviceBeanName(String adviceBeanName) Specify the name of the advice bean that this advisor should refer to.voidsetBeanFactory(BeanFactory beanFactory) Callback that supplies the owning factory to a bean instance.toString()Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisorequals, getOrder, hashCode, isPerInstance, setOrderMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.aop.PointcutAdvisorgetPointcut
- 
Constructor Details- 
AbstractBeanFactoryPointcutAdvisorpublic AbstractBeanFactoryPointcutAdvisor()
 
- 
- 
Method Details- 
setAdviceBeanNameSpecify 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. - See Also:
 
- 
getAdviceBeanNameReturn the name of the advice bean that this advisor refers to, if any.
- 
setBeanFactoryDescription copied from interface:BeanFactoryAwareCallback 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.- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
- Parameters:
- beanFactory- owning BeanFactory (never- null). The bean can immediately call methods on the factory.
- See Also:
 
- 
setAdviceSpecify a particular instance of the target advice directly, avoiding lazy resolution ingetAdvice().- Since:
- 3.1
 
- 
getAdviceDescription copied from interface:AdvisorReturn the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.
- 
toString
 
-