org.apache.geronimo.gjndi
Class KernelContextGBean

java.lang.Object
  extended by org.apache.xbean.naming.context.AbstractContext
      extended by org.apache.xbean.naming.context.AbstractFederatedContext
          extended by org.apache.xbean.naming.context.WritableContext
              extended by org.apache.geronimo.gjndi.KernelContextGBean
All Implemented Interfaces:
Serializable, Context, GBeanLifecycle, org.apache.xbean.naming.context.NestedContextFactory
Direct Known Subclasses:
GBeanFormatBinding, GlobalContextGBean

public class KernelContextGBean
extends org.apache.xbean.naming.context.WritableContext
implements GBeanLifecycle

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.xbean.naming.context.WritableContext
org.apache.xbean.naming.context.WritableContext.NestedWritableContext
 
Field Summary
static GBeanInfo GBEAN_INFO
           
 
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
 
Constructor Summary
KernelContextGBean(String nameInNamespace, AbstractNameQuery abstractNameQuery, Kernel kernel)
           
 
Method Summary
protected  void addBinding(AbstractName abstractName)
          Binds the specified gbean.
protected  Name createBindingName(AbstractName abstractName, Object value)
          Create a name under which we will bind the specified gbean with the specified value.
protected  Map<Name,Object> createBindings(AbstractName abstractName, Object value)
           
 void doFail()
          Fails the GBean.
 void doStart()
          Starts the GBean.
 void doStop()
          Stops the target.
static GBeanInfo getGBeanInfo()
           
protected  Object preprocessVaue(AbstractName abstractName, Name name, Object value)
          Preprocess the value before it is bound.
protected  void removeBinding(AbstractName abstractName)
          Unbinds the specified gbean.
 
Methods inherited from class org.apache.xbean.naming.context.WritableContext
addBinding, addBinding, createNestedSubcontext, getDeepBinding, getWrapperBindings, removeBinding
 
Methods inherited from class org.apache.xbean.naming.context.AbstractFederatedContext
addFederatedContext, faultLookup, getBinding, getBindings, getMasterContext, isNestedSubcontext
 
Methods inherited from class org.apache.xbean.naming.context.AbstractContext
addBinding, addDeepBinding, addToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, createSubcontextTree, destroySubcontext, destroySubcontext, getContextAccess, getEnvironment, getNameInNamespace, getNameInNamespace, getNameInNamespace, getNameParser, getNameParser, getNameParser, getParsedNameInNamespace, getSize, isEmpty, list, list, list, listBindings, listBindings, listBindings, lookup, lookup, lookup, lookupFinalContext, lookupLink, lookupLink, rebind, rebind, removeDeepBinding, removeDeepBinding, removeFromEnvironment, rename, rename, unbind, unbind
 
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

KernelContextGBean

public KernelContextGBean(String nameInNamespace,
                          AbstractNameQuery abstractNameQuery,
                          Kernel kernel)
                   throws NamingException
Throws:
NamingException
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

createBindings

protected Map<Name,Object> createBindings(AbstractName abstractName,
                                          Object value)
                                   throws NamingException
Throws:
NamingException

createBindingName

protected Name createBindingName(AbstractName abstractName,
                                 Object value)
                          throws NamingException
Create a name under which we will bind the specified gbean with the specified value. By default, this method simply returns the "name" element of the abstract name

Parameters:
abstractName - the abstract name of the gbean to bind
value - the gbean instance
Returns:
the name under which the gbean should be bound
Throws:
NamingException - should something go wrong

preprocessVaue

protected Object preprocessVaue(AbstractName abstractName,
                                Name name,
                                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
name - the name under which the gbean will be bound
value - the gbean instance
Returns:
the value to bind
Throws:
NamingException - should something go wrong

getGBeanInfo

public static GBeanInfo getGBeanInfo()


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.