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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExpose the aspect class loader that this factory uses.Look up the aspect bean from theBeanFactoryand return it.intgetOrder()voidsetAspectBeanName(String aspectBeanName) Set the name of the aspect bean.voidsetBeanFactory(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:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware
-
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:
-
ClassUtils.getDefaultClassLoader()
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-