org.apache.geronimo.gjndi.binding
Class GBeanBinding

java.lang.Object
  extended by org.apache.geronimo.gjndi.binding.GBeanBinding
All Implemented Interfaces:
GBeanLifecycle

public class GBeanBinding
extends Object
implements GBeanLifecycle


Field Summary
static GBeanInfo GBEAN_INFO
           
 
Constructor Summary
GBeanBinding(Context context, String name, AbstractNameQuery abstractNameQuery, Kernel kernel)
           
 
Method Summary
protected  void addBinding(AbstractName abstractName)
          Binds the specified gbean.
 void doFail()
          Fails the GBean.
 void doStart()
          Starts the GBean.
 void doStop()
          Stops the target.
static GBeanInfo getGBeanInfo()
           
protected  Object preprocessVaue(AbstractName abstractName, Object value)
          Preprocess the value before it is bound.
protected  void removeBinding(AbstractName abstractName)
          Unbinds the specified gbean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final GBeanInfo GBEAN_INFO
Constructor Detail

GBeanBinding

public GBeanBinding(Context context,
                    String name,
                    AbstractNameQuery abstractNameQuery,
                    Kernel kernel)
Method Detail

doStart

public void doStart()
Description copied from interface: GBeanLifecycle
Starts the GBean. This informs the GBean that it is about to transition to the running state.

Specified by:
doStart in interface GBeanLifecycle

doStop

public void doStop()
Description copied from interface: GBeanLifecycle
Stops the target. This informs the GBean that it is about to transition to the stopped state.

Specified by:
doStop in interface GBeanLifecycle

doFail

public void doFail()
Description copied from interface: GBeanLifecycle
Fails the GBean. This informs the GBean that it is about to transition to the failed state.

Specified by:
doFail in interface GBeanLifecycle

addBinding

protected void addBinding(AbstractName abstractName)
                   throws NamingException
Binds the specified gbean. This method uses createBindingName and preprocessValue before binding the object.

Parameters:
abstractName - the abstract name of the gbean to bind
Throws:
NamingException - if an error occurs during binding

removeBinding

protected void removeBinding(AbstractName abstractName)
Unbinds the specified gbean.

Parameters:
abstractName - the abstract name of the gbean to unbind

preprocessVaue

protected Object preprocessVaue(AbstractName abstractName,
                                Object value)
                         throws NamingException
Preprocess the value before it is bound. This is usefult for wrapping values with reference objects. By default, this method simply return the value.

Parameters:
abstractName - the abstract name of the gbean to bind
value - the gbean instance
Returns:
the value to bind
Throws:
NamingException

getGBeanInfo

public static GBeanInfo getGBeanInfo()


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.