com.aurorasoftworks.signal.runtime.core.context
Class AbstractBeanReference

java.lang.Object
  extended by com.aurorasoftworks.signal.runtime.core.context.AbstractBeanReference
All Implemented Interfaces:
IBeanReference, IBeanDelegate
Direct Known Subclasses:
EagerInitBeanReference, LazyInitBeanReference

public abstract class AbstractBeanReference
extends java.lang.Object
implements IBeanReference

A common superclass for implementations of IBeanReference.

Author:
Marek

Constructor Summary
protected AbstractBeanReference(java.lang.String name)
          Creates a new instance of AbstractBeanReference.
protected AbstractBeanReference(java.lang.String name, java.lang.Object bean)
          Creates a new instance of AbstractBeanReference.
 
Method Summary
 java.lang.Object getBean()
          Returns the wrapped bean.
 java.lang.Class getBeanClass()
          Returns the class of the wrapped bean.
 java.lang.String getName()
          Returns the name of the wrapped bean.
protected  void setBean(java.lang.Object bean)
          Allows subclasses to set the wrapped bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBeanReference

protected AbstractBeanReference(java.lang.String name)
Creates a new instance of AbstractBeanReference. The wrapped bean must be later specified by invoking setBean(Object).

Parameters:
name - name of the bean to wrapped

AbstractBeanReference

protected AbstractBeanReference(java.lang.String name,
                                java.lang.Object bean)
Creates a new instance of AbstractBeanReference.

Parameters:
name - name of the bean to wrapped
bean - the bean to be wrapped
Method Detail

getName

public java.lang.String getName()
Returns the name of the wrapped bean.

Specified by:
getName in interface IBeanReference
Returns:
name of the wrapped bean

getBean

public java.lang.Object getBean()
                         throws ContextException
Returns the wrapped bean.

Specified by:
getBean in interface IBeanReference
Specified by:
getBean in interface IBeanDelegate
Returns:
wrapped bean
Throws:
ContextException - if an error occurs while retrieving the bean

getBeanClass

public java.lang.Class getBeanClass()
Returns the class of the wrapped bean. This method is useful for determining a class of a bean that may not actually be created until IBeanDelegate.getBean() is invoked.

Specified by:
getBeanClass in interface IBeanDelegate
Returns:
class of the wrapped bean

setBean

protected void setBean(java.lang.Object bean)
                throws ContextException
Allows subclasses to set the wrapped bean. Useful for deferred instantiation.

Parameters:
bean -
Throws:
ContextException


Copyright © 2010. All Rights Reserved.