当前页面:
在线文档首页 >
Spring Framework 2.0.5 API 文档英文版
BeanFactoryRefreshableTargetSource (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版
org.springframework.aop.target.dynamic
Class BeanFactoryRefreshableTargetSource
java.lang.Object
org.springframework.aop.target.dynamic.AbstractRefreshableTargetSource
org.springframework.aop.target.dynamic.BeanFactoryRefreshableTargetSource
- All Implemented Interfaces:
- Refreshable, TargetClassAware, TargetSource
- Direct Known Subclasses:
- RefreshableScriptTargetSource
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.
- Since:
- 2.0
- Author:
- Rob Harrop, Rod Johnson, Juergen Hoeller
- See Also:
BeanFactory
,
AbstractRefreshableTargetSource.requiresRefresh()
,
AbstractRefreshableTargetSource.setRefreshCheckDelay(long)
Method Summary |
protected Object |
freshTarget()
Fetch a new target bean instance from the bean factory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeanFactoryRefreshableTargetSource
public BeanFactoryRefreshableTargetSource(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.
- Parameters:
beanFactory
- the BeanFactory to fetch beans frombeanName
- the name of the target bean
freshTarget
protected Object freshTarget()
- Fetch a new target bean instance from the bean factory.
- Specified by:
freshTarget
in class AbstractRefreshableTargetSource
- Returns:
- the fresh target object
- See Also:
BeanFactory.getBean(java.lang.String)
Copyright © 2002-2007 The Spring Framework.