org.springframework.aop.target.dynamic

## 类 BeanFactoryRefreshableTargetSource

- java.lang.Object
- - org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
  - - org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource

- 所有已实现的接口:
    Refreshable, TargetClassAware, TargetSource

      public class BeanFactoryRefreshableTargetSource
      extends AbstractRefreshableTargetSource

  Refreshable TargetSource that fetches fresh target beans from a BeanFactory.

  Can be subclassed to override `requiresRefresh()` to suppress unnecessary refreshes. By default, a refresh will be performed every time the "refreshCheckDelay" has elapsed.

  从以下版本开始:
    2.0
  作者:
    Rob Harrop, Rod Johnson, Juergen Hoeller, Mark Fisher
  另请参阅:
    `BeanFactory`, `AbstractRefreshableTargetSource.requiresRefresh()`, `AbstractRefreshableTargetSource.setRefreshCheckDelay(long)`

- - ### 字段概要

    - ### 从类继承的字段 org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource

      `logger, targetObject`

  - ### 构造器概要

    构造器
    构造器和说明
    `BeanFactoryRefreshableTargetSource(org.springframework.beans.factory.BeanFactory beanFactory, String beanName)` Create a new BeanFactoryRefreshableTargetSource for the given bean factory and bean name.

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected Object` | `freshTarget()` Retrieve a fresh target object.
    `protected Object` | `obtainFreshBean(org.springframework.beans.factory.BeanFactory beanFactory, String beanName)` A template method that subclasses may override to provide a fresh target object for the given bean factory and bean name.

    - ### 从类继承的方法 org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource

      `getLastRefreshTime, getRefreshCount, getTarget, getTargetClass, isStatic, refresh, releaseTarget, requiresRefresh, setRefreshCheckDelay`

    - ### 从类继承的方法 java.lang.Object

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

- - ### 构造器详细资料

    - #### BeanFactoryRefreshableTargetSource

          public BeanFactoryRefreshableTargetSource(org.springframework.beans.factory.BeanFactory beanFactory,
                                                    String beanName)

      Create a new BeanFactoryRefreshableTargetSource for the given bean factory and bean name.

      Note that the passed-in BeanFactory should have an appropriate bean definition set up for the given bean name.

      参数:
        `beanFactory` - the BeanFactory to fetch beans from
        `beanName` - the name of the target bean

  - ### 方法详细资料

    - #### freshTarget

          protected final Object freshTarget()

      Retrieve a fresh target object.
      指定者:
        `freshTarget` 在类中 `AbstractRefreshableTargetSource`
      返回:
        the fresh target object

    - #### obtainFreshBean

          protected Object obtainFreshBean(org.springframework.beans.factory.BeanFactory beanFactory,
                                           String beanName)

      A template method that subclasses may override to provide a fresh target object for the given bean factory and bean name.

      This default implementation fetches a new target bean instance from the bean factory.

      另请参阅:
        `BeanFactory.getBean(java.lang.String)`