接口 BeanFactoryReference
- 所有已知实现类:
ContextBeanFactoryReference
public interface BeanFactoryReference
Used to track a reference to aBeanFactory
obtained through aBeanFactoryLocator
.It is safe to call
release()
multiple times, butgetFactory()
must not be called after calling release.- 作者:
- Colin Sampaleanu
- 另请参阅:
BeanFactoryLocator
,ContextBeanFactoryReference
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 BeanFactory
getFactory()
Return theBeanFactory
instance held by this reference.void
release()
Indicate that theBeanFactory
instance referred to by this object is not needed any longer by the client code which obtained theBeanFactoryReference
.
方法详细资料
getFactory
BeanFactory getFactory()
Return theBeanFactory
instance held by this reference.- 抛出:
IllegalStateException
- if invoked afterrelease()
has been called
release
void release()
Indicate that theBeanFactory
instance referred to by this object is not needed any longer by the client code which obtained theBeanFactoryReference
.Depending on the actual implementation of
BeanFactoryLocator
, and the actual type ofBeanFactory
, this may possibly not actually do anything; alternately in the case of a 'closeable'BeanFactory
or derived class (such asApplicationContext
) may 'close' it, or may 'close' it once no more references remain.In an EJB usage scenario this would normally be called from
ejbRemove()
andejbPassivate()
.This is safe to call multiple times.