|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Revisions:
20030806 Juha Lindfors:
-
Added releaseRegistry() method to the interface as per the patch
submitted by Rod Burgett (Bug Tracker: #763378)
Field Summary |
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 |
public ObjectInstance registerMBean(Object object, ObjectName name, Map valueMap) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
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.
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
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.public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException
This method is invoked by the MBeanServer for unregisterMBean().
The object name passed maybe unqualified.
MBeans in JMImplementation cannot be unregistered
name
- the mbean to unregister.
InstanceNotFoundException
- when the object name is
not registered.
MBeanRegistrationException
- when an exception is raised
during preDeregister for the mbean.public MBeanEntry get(ObjectName name) throws InstanceNotFoundException
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.
name
- the object name to retrieve
InstanceNotFoundException
- when the object name is not
registered.public String getDefaultDomain()
public String[] getDomains()
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException
name
- the object name of the mbean
InstanceNotFoundException
- when the object name is not
registeredpublic Object getValue(ObjectName name, String key) throws InstanceNotFoundException
name
- the object name of the mbeankey
- the key to the value
InstanceNotFoundException
- when the object name is not
registeredpublic boolean contains(ObjectName name)
This method is invoked by the MBeanServer for isRegistered().
The object name passed maybe unqualified.
name
- the object name
public List findEntries(ObjectName pattern)
This method is invoked by the MBeanServer for queryMBeans() and queryNames().
pattern
- the pattern to match
public int getSize()
This method is invoked by the MBeanServer for getMBeanCount().
public void releaseRegistry()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |