public class

SimpleBeanFactoryAwareAspectInstanceFactory

extends Object
implements AspectInstanceFactory BeanFactoryAware
java.lang.Object
   ↳ org.springframework.aop.config.SimpleBeanFactoryAwareAspectInstanceFactory

Class Overview

Implementation of AspectInstanceFactory that locates the aspect from the BeanFactory using a configured bean name.

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.Ordered
Public Constructors
SimpleBeanFactoryAwareAspectInstanceFactory()
Public Methods
ClassLoader getAspectClassLoader()
Expose the aspect class loader that this factory uses.
Object getAspectInstance()
Look up the aspect bean from the BeanFactory and returns it.
int getOrder()
Return the order value of this object, with a higher value meaning greater in terms of sorting.
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.aop.aspectj.AspectInstanceFactory
From interface org.springframework.beans.factory.BeanFactoryAware
From interface org.springframework.core.Ordered

Public Constructors

public SimpleBeanFactoryAwareAspectInstanceFactory ()

Public Methods

public ClassLoader getAspectClassLoader ()

Expose the aspect class loader that this factory uses.

Returns
  • the aspect class loader (never null)

public Object getAspectInstance ()

Look up the aspect bean from the BeanFactory and returns it.

Returns
  • the aspect instance (never null)

public int getOrder ()

Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Returns
  • the order value

public void setAspectBeanName (String aspectBeanName)

Set the name of the aspect bean. This is the bean that is returned when calling getAspectInstance().

public void setBeanFactory (BeanFactory beanFactory)

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 afterPropertiesSet() or a custom init-method.

Parameters
beanFactory owning BeanFactory (never null). The bean can immediately call methods on the factory.