站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jmx API Documentation 英文版文档

MBeanRegistry (JBoss/JMX API) - JBoss 4.0.1 sp1 jmx API Documentation 英文版文档


org.jboss.mx.server.registry
Interface MBeanRegistry

All Superinterfaces:
ServerConstants
All Known Implementing Classes:
BasicMBeanRegistry

public interface MBeanRegistry
extends ServerConstants

Implementations of this interface can be plugged into the MBeanServer, to control the registration and deregistration of MBeans.

The registry can expose itself for management under the object name defined the name defined in ServerConstants When this is the case, the MBeanServer will perform the register/unregister operations dynamically.

Version:
$Revision: 1.13 $
Author:
Juha Lindfors., Trevor Squires., Adrian Brock.
See Also:

Revisions:

20030806 Juha Lindfors:

  • Added releaseRegistry() method to the interface as per the patch submitted by Rod Burgett (Bug Tracker: #763378)

Field Summary
 
Fields inherited from interface org.jboss.mx.server.ServerConstants
CLASS_REMOVED, CLASSLOADER, CLASSLOADER_ADDED, CLASSLOADER_REMOVED, DEFAULT_DOMAIN, DEFAULT_LOADER_NAME, DEFAULT_LOADER_REPOSITORY_CLASS, DEFAULT_MBEAN_REGISTRY_CLASS, DEFAULT_MBEAN_SERVER_BUILDER_CLASS, DEFAULT_REQUIRED_MODELMBEAN_CLASS, DEFAULT_SCOPED_REPOSITORY_CLASS, DEFAULT_SCOPED_REPOSITORY_PARSER_CLASS, IMPLEMENTATION_NAME, IMPLEMENTATION_VENDOR, IMPLEMENTATION_VERSION, JMI_DOMAIN, LOADER_REPOSITORY_CLASS_PROPERTY, MBEAN_REGISTRY, MBEAN_REGISTRY_CLASS_PROPERTY, MBEAN_SERVER_BUILDER_CLASS_PROPERTY, MBEAN_SERVER_CONFIGURATION, MBEAN_SERVER_DELEGATE, OPTIMIZE_REFLECTED_DISPATCHER, REQUIRED_MODELMBEAN_CLASS_PROPERTY, SPECIFICATION_NAME, SPECIFICATION_VENDOR, SPECIFICATION_VERSION, UNIFIED_LOADER_REPOSITORY_CLASS
 
Method Summary
 boolean contains(ObjectName name)
          Test whether an object name is registered.
 List findEntries(ObjectName pattern)
          Return a List of MBeanEntry objects with ObjectNames that match the specified pattern.
 MBeanEntry get(ObjectName name)
          Retrieve the registration for an object name.
 String getDefaultDomain()
          Retrieve the default domain for this registry.
 String[] getDomains()
          Retrieve the domains for this registry.
 ObjectInstance getObjectInstance(ObjectName name)
          Retrieve the object instance for an object name.
 int getSize()
          Retrieve the number of mbeans registered.
 Object getValue(ObjectName name, String key)
          Retrieve a value from the registration.
 ObjectInstance registerMBean(Object object, ObjectName name, Map valueMap)
          Register an mbean.
 void releaseRegistry()
          Invoked before the MBean server instance is released.
 void unregisterMBean(ObjectName name)
          Unregister an mbean.
 

Method Detail

registerMBean

public ObjectInstance registerMBean(Object object,
                                    ObjectName name,
                                    Map valueMap)
                             throws InstanceAlreadyExistsException,
                                    MBeanRegistrationException,
                                    NotCompliantMBeanException
Register an mbean.

This method is invoked by the MBeanServer for createMBean() and registerMBean().

The object name passed maybe unqualified.

The map is a user definable string to value object map for holding information against a registered object. This map may contain metadata related to the registration, such as registration date/time, classloader references, etc.

Pass JMI_DOMAIN in both the key and values of the values map to get access to the reserved domain. It is removed from the map during registration to save memory.

Pass CLASSLOADER in the values map to set the context classloader

Other values are user definable and can be retrieved using the getValue(ObjectName,String) method.

Parameters:
object - the mbean to register.
name - the object name to assign to the mbean.
valueMap - a map of other information to include in the registry
Returns:
an object instance for the registered mbean
Throws:
InstanceAlreadyExistsException - when the object name is already registered.
MBeanRegistrationException - when an exception is raised during preRegister for the mbean.
NotCompliantMBeanException - when the passed object is a valid mbean.

unregisterMBean

public void unregisterMBean(ObjectName name)
                     throws InstanceNotFoundException,
                            MBeanRegistrationException
Unregister an mbean.

This method is invoked by the MBeanServer for unregisterMBean().

The object name passed maybe unqualified.

MBeans in JMImplementation cannot be unregistered

Parameters:
name - the mbean to unregister.
Throws:
InstanceNotFoundException - when the object name is not registered.
MBeanRegistrationException - when an exception is raised during preDeregister for the mbean.

get

public MBeanEntry get(ObjectName name)
               throws InstanceNotFoundException
Retrieve the registration for an object name.

This method is invoked by the MBeanServer for methods passing an ObjectName that are not covered in other methods.

The object name passed maybe unqualified.

Parameters:
name - the object name to retrieve
Returns:
the mbean's registration
Throws:
InstanceNotFoundException - when the object name is not registered.

getDefaultDomain

public String getDefaultDomain()
Retrieve the default domain for this registry.

Returns:
the default domain

getDomains

public String[] getDomains()
Retrieve the domains for this registry.

Returns:
the domains

getObjectInstance

public ObjectInstance getObjectInstance(ObjectName name)
                                 throws InstanceNotFoundException
Retrieve the object instance for an object name.

Parameters:
name - the object name of the mbean
Returns:
the object instance
Throws:
InstanceNotFoundException - when the object name is not registered

getValue

public Object getValue(ObjectName name,
                       String key)
                throws InstanceNotFoundException
Retrieve a value from the registration.

Parameters:
name - the object name of the mbean
key - the key to the value
Returns:
the value or null if there is no such value
Throws:
InstanceNotFoundException - when the object name is not registered

contains

public boolean contains(ObjectName name)
Test whether an object name is registered.

This method is invoked by the MBeanServer for isRegistered().

The object name passed maybe unqualified.

Parameters:
name - the object name
Returns:
true when the object name is registered, false otherwise

findEntries

public List findEntries(ObjectName pattern)
Return a List of MBeanEntry objects with ObjectNames that match the specified pattern.

This method is invoked by the MBeanServer for queryMBeans() and queryNames().

Parameters:
pattern - the pattern to match
Returns:
a List of entries matching the pattern

getSize

public int getSize()
Retrieve the number of mbeans registered.

This method is invoked by the MBeanServer for getMBeanCount().

Returns:
the number of mbeans registered.

releaseRegistry

public void releaseRegistry()
Invoked before the MBean server instance is released. Implementing this method lets the registry to process any clean up before the MBean server is shut down.



Copyright © 2002 JBoss Group, LLC. All Rights Reserved.