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
Constructor
Description
`SimpleBeanFactoryAwareAspectInstanceFactory()`

## Method Summary

Modifier and Type
Method
Description
`ClassLoader`
`getAspectClassLoader()`
Expose the aspect class loader that this factory uses.
`Object`
`getAspectInstance()`
Look up the aspect bean from the `BeanFactory` and return it.
`int`
`getOrder()`
`void`
`setAspectBeanName(String aspectBeanName)`
Set the name of the aspect bean.
`void`
`setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SimpleBeanFactoryAwareAspectInstanceFactory

public SimpleBeanFactoryAwareAspectInstanceFactory()

## Method Details

### setAspectBeanName

public void setAspectBeanName(String aspectBeanName)
Set the name of the aspect bean. This is the bean that is returned when calling `getAspectInstance()`.

### setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)

Specified by:
  `setBeanFactory` in interface `org.springframework.beans.factory.BeanFactoryAware`

### getAspectInstance

public Object getAspectInstance()
Look up the aspect bean from the `BeanFactory` and return it.

Specified by:
  `getAspectInstance` in interface `AspectInstanceFactory`
Returns:
  the aspect instance (never `null`)
See Also:
  - `setAspectBeanName(java.lang.String)`

### getAspectClassLoader

@Nullable public ClassLoader getAspectClassLoader()
Description copied from interface: `AspectInstanceFactory`
Expose the aspect class loader that this factory uses.

Specified by:
  `getAspectClassLoader` in interface `AspectInstanceFactory`
Returns:
  the aspect class loader (or `null` for the bootstrap loader)
See Also:
  - `ClassUtils.getDefaultClassLoader()`

### getOrder

public int getOrder()

Specified by:
  `getOrder` in interface `org.springframework.core.Ordered`