Interface BeanFactoryReference
- All Known Implementing Classes:
ContextBeanFactoryReference
public interface BeanFactoryReference
Used to track a reference to aBeanFactoryobtained through aBeanFactoryLocator.It is safe to call
release()multiple times, butgetFactory()must not be called after calling release.- Author:
- Colin Sampaleanu
- See Also:
BeanFactoryLocator,ContextBeanFactoryReference
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BeanFactorygetFactory()Return theBeanFactoryinstance held by this reference.voidrelease()Indicate that theBeanFactoryinstance referred to by this object is not needed any longer by the client code which obtained theBeanFactoryReference.
Method Detail
getFactory
BeanFactory getFactory()
Return theBeanFactoryinstance held by this reference.- Throws:
IllegalStateException- if invoked afterrelease()has been called
release
void release()
Indicate that theBeanFactoryinstance 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'BeanFactoryor 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.