org.apache.geronimo.kernel.basic
Class BasicRegistry

java.lang.Object
  extended by org.apache.geronimo.kernel.basic.BasicRegistry
All Implemented Interfaces:
InstanceRegistry

public class BasicRegistry
extends Object
implements InstanceRegistry


Constructor Summary
BasicRegistry()
           
 
Method Summary
 GBeanInstance getGBeanInstance(AbstractName abstractName)
           
 GBeanInstance getGBeanInstance(ObjectName name)
          Return the GBeanInstance registered with the supplied name.
 GBeanInstance getGBeanInstance(String shortName, Class type)
           
 GBeanInstance getGBeanInstanceByInstance(Object instance)
           
 void instanceCreated(Object instance, GBeanInstance gbeanInstance)
           
 void instanceDestroyed(Object instance)
           
 boolean isRegistered(AbstractName refInfo)
           
 boolean isRegistered(ObjectName name)
          See if there is a GBean registered with a specific name.
 Set listGBeans(AbstractNameQuery query)
           
 Set listGBeans(ObjectName pattern)
          Search the objectNameRegistry for GBeans matching a name pattern.
 void register(GBeanInstance gbeanInstance)
          Register a GBean instance.
 void start(Kernel kernel)
          Start the objectNameRegistry and associate it with a kernel.
 void stop()
          Shut down the objectNameRegistry and unregister any GBeans
 void unregister(AbstractName abstractName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicRegistry

public BasicRegistry()
Method Detail

start

public void start(Kernel kernel)
Start the objectNameRegistry and associate it with a kernel.

Parameters:
kernel - the kernel to associate with

stop

public void stop()
Shut down the objectNameRegistry and unregister any GBeans


isRegistered

public boolean isRegistered(ObjectName name)
See if there is a GBean registered with a specific name.

Parameters:
name - the name of the GBean to check for
Returns:
true if there is a GBean registered with that name

isRegistered

public boolean isRegistered(AbstractName refInfo)

register

public void register(GBeanInstance gbeanInstance)
              throws GBeanAlreadyExistsException
Register a GBean instance.

Parameters:
gbeanInstance - the GBean to register
Throws:
GBeanAlreadyExistsException - if there is already a GBean registered with the instance's name

unregister

public void unregister(AbstractName abstractName)
                throws GBeanNotFoundException
Throws:
GBeanNotFoundException

instanceCreated

public void instanceCreated(Object instance,
                            GBeanInstance gbeanInstance)
Specified by:
instanceCreated in interface InstanceRegistry

instanceDestroyed

public void instanceDestroyed(Object instance)
Specified by:
instanceDestroyed in interface InstanceRegistry

getGBeanInstanceByInstance

public GBeanInstance getGBeanInstanceByInstance(Object instance)

getGBeanInstance

public GBeanInstance getGBeanInstance(ObjectName name)
                               throws GBeanNotFoundException
Return the GBeanInstance registered with the supplied name.

Parameters:
name - the name of the instance to return
Returns:
the GBeanInstance
Throws:
GBeanNotFoundException - if there is no GBean registered with the supplied name

getGBeanInstance

public GBeanInstance getGBeanInstance(AbstractName abstractName)
                               throws GBeanNotFoundException
Throws:
GBeanNotFoundException

getGBeanInstance

public GBeanInstance getGBeanInstance(String shortName,
                                      Class type)
                               throws GBeanNotFoundException
Throws:
GBeanNotFoundException

listGBeans

public Set listGBeans(ObjectName pattern)
Search the objectNameRegistry for GBeans matching a name pattern.

Parameters:
pattern - the object name pattern to search for
Returns:
an unordered Set of GBeans that matched the pattern

listGBeans

public Set listGBeans(AbstractNameQuery query)


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