Top Description Fields Constructors Methods
org.springframework.aop.support

public abstract Class AbstractBeanFactoryPointcutAdvisor

extends AbstractPointcutAdvisor
implements BeanFactoryAware
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.Aware
Known Direct Subclasses
org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor
Annotations
@SuppressWarnings:serial
Imports
java.io.IOException, .ObjectInputStream, org.aopalliance.aop.Advice, org.springframework.beans.factory.BeanFactory, .BeanFactoryAware, org.springframework.beans.factory.config.ConfigurableBeanFactory, org.springframework.lang.Nullable, org.springframework.util.Assert

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.

Author
Juergen Hoeller
Since
2.0.2
See Also
setAdviceBeanName, DefaultBeanFactoryPointcutAdvisor

Field Summary

Modifier and TypeField and Description
private transient volatile Advice
private String
private transient volatile Object
private BeanFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Advice
getAdvice()

Implements org.springframework.aop.Advisor.getAdvice.

Return the advice part of this aspect.
public String
getAdviceBeanName()

Return the name of the advice bean that this advisor refers to, if any.

private void
private void
public void
setAdvice(Advice advice)

Specify a particular instance of the target advice directly, avoiding lazy resolution in getAdvice().

public void
setAdviceBeanName(String adviceBeanName)

Specify the name of the advice bean that this advisor should refer to.

public void
setBeanFactory(BeanFactory
owning BeanFactory (never null). The bean can immediately call methods on the factory.
beanFactory
)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Callback that supplies the owning factory to a bean instance.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.springframework.aop.support.AbstractPointcutAdvisor:
equalsgetOrderhashCodesetOrder

Field Detail

adviceback to summary
private transient volatile Advice advice
Annotations
@Nullable
adviceBeanNameback to summary
private String adviceBeanName
Annotations
@Nullable
adviceMonitorback to summary
private transient volatile Object adviceMonitor
beanFactoryback to summary
private BeanFactory beanFactory
Annotations
@Nullable

Constructor Detail

AbstractBeanFactoryPointcutAdvisorback to summary
public AbstractBeanFactoryPointcutAdvisor()

Method Detail

getAdviceback to summary
public Advice getAdvice()

Implements org.springframework.aop.Advisor.getAdvice.

Doc from org.springframework.aop.Advisor.getAdvice.

Return the advice part of this aspect. An advice may be an interceptor, a before advice, a throws advice, etc.

Returns:Advice

the advice that should apply if the pointcut matches

Annotations
@Override
getAdviceBeanNameback to summary
public String getAdviceBeanName()

Return the name of the advice bean that this advisor refers to, if any.

Annotations
@Nullable
readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException
resetAdviceMonitorback to summary
private void resetAdviceMonitor()
setAdviceback to summary
public void setAdvice(Advice advice)

Specify a particular instance of the target advice directly, avoiding lazy resolution in getAdvice().

Since
3.1
setAdviceBeanNameback to summary
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
getAdvice()
setBeanFactoryback to summary
public void setBeanFactory(BeanFactory beanFactory)

Implements org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

Doc from org.springframework.beans.factory.BeanFactoryAware.setBeanFactory.

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.

Parameters
beanFactory:BeanFactory

owning BeanFactory (never null). The bean can immediately call methods on the factory.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override