Package org.springframework.aop.config
Class SimpleBeanFactoryAwareAspectInstanceFactory
java.lang.Object
org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory
- All Implemented Interfaces:
AspectInstanceFactory
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.core.Ordered
public class SimpleBeanFactoryAwareAspectInstanceFactory
extends Object
implements AspectInstanceFactory, org.springframework.beans.factory.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()
void
setAspectBeanName
(String aspectBeanName) Set the name of the aspect bean.void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory)
-
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
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) - Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
-
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:
-
ClassUtils.getDefaultClassLoader()
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-