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 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 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionExpose the aspect class loader that this factory uses.Look up the aspect bean from theBeanFactory
and return it.int
getOrder()
Get the order value of this object.void
setAspectBeanName
(String aspectBeanName) Set the name of the aspect bean.void
setBeanFactory
(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:BeanFactoryAware
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.- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Parameters:
beanFactory
- owning BeanFactory (nevernull
). The bean can immediately call methods on the factory.- See Also:
-
getAspectInstance
Look up the aspect bean from theBeanFactory
and return it.- Specified by:
getAspectInstance
in interfaceAspectInstanceFactory
- Returns:
- the aspect instance (never
null
) - See Also:
-
getAspectClassLoader
Description copied from interface:AspectInstanceFactory
Expose the aspect class loader that this factory uses.- Specified by:
getAspectClassLoader
in interfaceAspectInstanceFactory
- Returns:
- the aspect class loader (or
null
for the bootstrap loader) - See Also:
-
getOrder
public int getOrder()Description copied from interface:Ordered
Get 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-startup
values).Same order values will result in arbitrary sort positions for the affected objects.
-