private class SingletonBeanFactoryLocator.CountingBeanFactoryReference extends java.lang.Object implements BeanFactoryReference
Modifier and Type | Field and Description |
---|---|
private BeanFactory |
beanFactory |
private BeanFactory |
groupContextRef |
Constructor and Description |
---|
CountingBeanFactoryReference(BeanFactory beanFactory,
BeanFactory groupContext) |
Modifier and Type | Method and Description |
---|---|
BeanFactory |
getFactory()
Return the
BeanFactory instance held by this reference. |
void |
release()
Indicate that the
BeanFactory instance referred to by this object is not
needed any longer by the client code which obtained the BeanFactoryReference . |
private BeanFactory beanFactory
private BeanFactory groupContextRef
public CountingBeanFactoryReference(BeanFactory beanFactory, BeanFactory groupContext)
public BeanFactory getFactory()
BeanFactoryReference
BeanFactory
instance held by this reference.getFactory
in interface BeanFactoryReference
public void release() throws FatalBeanException
BeanFactoryReference
BeanFactory
instance referred to by this object is not
needed any longer by the client code which obtained the BeanFactoryReference
.
Depending on the actual implementation of BeanFactoryLocator
, and
the actual type of BeanFactory
, this may possibly not actually
do anything; alternately in the case of a 'closeable' BeanFactory
or derived class (such as ApplicationContext
)
may 'close' it, or may 'close' it once no more references remain.
In an EJB usage scenario this would normally be called from
ejbRemove()
and ejbPassivate()
.
This is safe to call multiple times.
release
in interface BeanFactoryReference
FatalBeanException
BeanFactoryLocator
,
ContextBeanFactoryReference
,
ConfigurableApplicationContext.close()