org.springframework.aop.support
Class AbstractBeanFactoryPointcutAdvisor
java.lang.Object
org.springframework.aop.support.AbstractPointcutAdvisor
org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
- All Implemented Interfaces:
- java.io.Serializable, Advisor, PointcutAdvisor, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.core.Ordered
- Direct Known Subclasses:
- DefaultBeanFactoryPointcutAdvisor
public abstract class AbstractBeanFactoryPointcutAdvisor
- extends AbstractPointcutAdvisor
- implements org.springframework.beans.factory.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:
setAdviceBeanName(java.lang.String)
,
DefaultBeanFactoryPointcutAdvisor
,
Serialized Form
Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Method Summary |
org.aopalliance.aop.Advice |
getAdvice()
Return the advice part of this aspect. |
java.lang.String |
getAdviceBeanName()
Return the name of the advice bean that this advisor refers to, if any. |
void |
setAdvice(org.aopalliance.aop.Advice advice)
|
void |
setAdviceBeanName(java.lang.String adviceBeanName)
Specify the name of the advice bean that this advisor should refer to. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
AbstractBeanFactoryPointcutAdvisor
public AbstractBeanFactoryPointcutAdvisor()
setAdviceBeanName
public void setAdviceBeanName(java.lang.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:
getAdvice()
getAdviceBeanName
public java.lang.String getAdviceBeanName()
- Return the name of the advice bean that this advisor refers to, if any.
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
- Specified by:
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
setAdvice
public void setAdvice(org.aopalliance.aop.Advice advice)
getAdvice
public org.aopalliance.aop.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
- Returns:
- the advice that should apply if the pointcut matches
- See Also:
MethodInterceptor
,
BeforeAdvice
,
ThrowsAdvice
,
AfterReturningAdvice
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object