|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aurorasoftworks.signal.runtime.core.context.AbstractBeanReference
com.aurorasoftworks.signal.runtime.core.context.LazyInitBeanReference
public abstract class LazyInitBeanReference
A reference to a lazily-initialized bean. This class acts
like a bean factory that creates a bean when getBean()
is invoked for the first time.
Note: methods of this class are not thread-safe because it is assumed
that the calling context is responsible for synchronization.
Constructor Summary | |
---|---|
LazyInitBeanReference(java.lang.String name,
java.lang.Class beanClass)
Creates a new instance of LazyInitBeanReference. |
Method Summary | |
---|---|
protected abstract java.lang.Object |
createBean()
Creates a wrapped bean on demand. |
java.lang.Object |
getBean()
Returns the wrapped bean. |
java.lang.Class |
getBeanClass()
Returns the class of the wrapped bean. |
Methods inherited from class com.aurorasoftworks.signal.runtime.core.context.AbstractBeanReference |
---|
getName, setBean |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LazyInitBeanReference(java.lang.String name, java.lang.Class beanClass)
createBean()
method.
name
- name of the wrapped beanbeanClass
- class of the wrapped beanMethod Detail |
---|
public java.lang.Object getBean() throws ContextException
getBean
in interface IBeanReference
getBean
in interface IBeanDelegate
getBean
in class AbstractBeanReference
ContextException
- if an error occurs while
retrieving the beanprotected abstract java.lang.Object createBean() throws java.lang.Exception
getBean()
is executed for the first time.
java.lang.Exception
- if an error occurs while creating the beanpublic java.lang.Class getBeanClass()
AbstractBeanReference
IBeanDelegate.getBean()
is invoked.
getBeanClass
in interface IBeanDelegate
getBeanClass
in class AbstractBeanReference
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |