Package org.springframework.aop.config
Class SimpleBeanFactoryAwareAspectInstanceFactory
- java.lang.Object
- org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory
- All Implemented Interfaces:
AspectInstanceFactory,Aware,BeanFactoryAware,Ordered
public class SimpleBeanFactoryAwareAspectInstanceFactory extends Object implements AspectInstanceFactory, BeanFactoryAware
Implementation ofAspectInstanceFactorythat locates the aspect from theBeanFactoryusing a configured bean name.- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
Constructors Constructor Description SimpleBeanFactoryAwareAspectInstanceFactory()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassLoadergetAspectClassLoader()Expose the aspect class loader that this factory uses.ObjectgetAspectInstance()Look up the aspect bean from theBeanFactoryand returns it.intgetOrder()Get the order value of this object.voidsetAspectBeanName(String aspectBeanName)Set the name of the aspect bean.voidsetBeanFactory(BeanFactory beanFactory)Callback that supplies the owning factory to a bean instance.
Constructor Detail
SimpleBeanFactoryAwareAspectInstanceFactory
public SimpleBeanFactoryAwareAspectInstanceFactory()
Method Detail
setAspectBeanName
public void setAspectBeanName(String aspectBeanName)
Set the name of the aspect bean. This is the bean that is returned when callinggetAspectInstance().
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
Description 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 interfaceBeanFactoryAware- Parameters:
beanFactory- owning BeanFactory (nevernull). The bean can immediately call methods on the factory.- See Also:
BeanInitializationException
getAspectInstance
public Object getAspectInstance()
Look up the aspect bean from theBeanFactoryand returns it.- Specified by:
getAspectInstancein interfaceAspectInstanceFactory- Returns:
- the aspect instance (never
null) - See Also:
setAspectBeanName(java.lang.String)
getAspectClassLoader
public ClassLoader getAspectClassLoader()
Description copied from interface:AspectInstanceFactoryExpose the aspect class loader that this factory uses.- Specified by:
getAspectClassLoaderin interfaceAspectInstanceFactory- Returns:
- the aspect class loader (never
null)
getOrder
public int getOrder()
Description copied from interface:OrderedGet the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet
load-on-startupvalues).Same order values will result in arbitrary sort positions for the affected objects.
- Specified by:
getOrderin interfaceOrdered- Returns:
- the order value
- See Also:
Ordered.HIGHEST_PRECEDENCE,Ordered.LOWEST_PRECEDENCE