Class AbstractBeanFactoryPointcutAdvisor

  extended by
      extended by
All Implemented Interfaces:
Serializable, Advisor, PointcutAdvisor, BeanFactoryAware, Ordered
Direct Known Subclasses:
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.

Juergen Hoeller
See Also:
setAdviceBeanName(java.lang.String), DefaultBeanFactoryPointcutAdvisor, Serialized Form

Field Summary
Fields inherited from interface org.springframework.core.Ordered
Constructor Summary
Method Summary
 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 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()
Methods inherited from class
equals, getOrder, hashCode, isPerInstance, setOrder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.aop.PointcutAdvisor

Constructor Detail


public AbstractBeanFactoryPointcutAdvisor()
Method Detail


public void setAdviceBeanName(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.

See Also:


public String getAdviceBeanName()
Return the name of the advice bean that this advisor refers to, if any.


public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: 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.

Specified by:
setBeanFactory in interface BeanFactoryAware
beanFactory - owning BeanFactory (never null). The bean can immediately call methods on the factory.
See Also:


public Advice getAdvice()
Description copied from interface: Advisor
Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Specified by:
getAdvice in interface Advisor
the advice that should apply if the pointcut matches
See Also:
MethodInterceptor, BeforeAdvice, ThrowsAdvice, AfterReturningAdvice


public String toString()
toString in class Object

Copyright © 2002-2008 The Spring Framework.