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 of
AspectInstanceFactory that locates the aspect from the
BeanFactory using a configured bean name.- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller
-
Field Summary
Fields inherited from interface Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExpose the aspect class loader that this factory uses.Look up the aspect bean from theBeanFactoryand return 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 Details
-
SimpleBeanFactoryAwareAspectInstanceFactory
public SimpleBeanFactoryAwareAspectInstanceFactory()
-
-
Method Details
-
setAspectBeanName
Set the name of the aspect bean. This is the bean that is returned when callinggetAspectInstance(). -
setBeanFactory
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:
-
getAspectInstance
Look up the aspect bean from theBeanFactoryand return it.- Specified by:
getAspectInstancein interfaceAspectInstanceFactory- Returns:
- the aspect instance (never
null) - See Also:
-
getAspectClassLoader
Description copied from interface:AspectInstanceFactoryExpose the aspect class loader that this factory uses.- Specified by:
getAspectClassLoaderin interfaceAspectInstanceFactory- Returns:
- the aspect class loader (or
nullfor the bootstrap loader) - See Also:
-
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.
-