|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.aop.support.AbstractPointcutAdvisor org.springframework.aop.support.AbstractBeanFactoryPointcutAdvisor
public abstract class AbstractBeanFactoryPointcutAdvisor
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.
setAdviceBeanName(java.lang.String)
,
DefaultBeanFactoryPointcutAdvisor
,
Serialized FormField Summary | |
---|---|
private Advice |
advice
|
private java.lang.String |
adviceBeanName
|
private java.lang.Object |
adviceMonitor
|
private BeanFactory |
beanFactory
|
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
AbstractBeanFactoryPointcutAdvisor()
|
Method Summary | |
---|---|
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. |
private void |
readObject(java.io.ObjectInputStream ois)
|
void |
setAdvice(Advice advice)
|
void |
setAdviceBeanName(java.lang.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. |
java.lang.String |
toString()
|
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor |
---|
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 |
---|
getPointcut |
Field Detail |
---|
private java.lang.String adviceBeanName
private BeanFactory beanFactory
private transient Advice advice
private transient volatile java.lang.Object adviceMonitor
Constructor Detail |
---|
public AbstractBeanFactoryPointcutAdvisor()
Method Detail |
---|
public void setAdviceBeanName(java.lang.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 java.lang.String getAdviceBeanName()
public void setBeanFactory(BeanFactory beanFactory)
BeanFactoryAware
Invoked after the population of normal bean properties
but before an initialization callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method.
setBeanFactory
in interface BeanFactoryAware
beanFactory
- owning BeanFactory (never null
).
The bean can immediately call methods on the factory.BeanInitializationException
public void setAdvice(Advice advice)
public Advice getAdvice()
Advisor
getAdvice
in interface Advisor
org.aopalliance.intercept.MethodInterceptor
,
BeforeAdvice
,
ThrowsAdvice
,
AfterReturningAdvice
public java.lang.String toString()
toString
in class java.lang.Object
private void readObject(java.io.ObjectInputStream ois) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |