public class MBeanRegistry extends Object
Constructor and Description |
---|
MBeanRegistry() |
Modifier and Type | Method and Description |
---|---|
static MBeanRegistry |
getInstance() |
MBeanServer |
getPlatformMBeanServer()
Return the underlying MBeanServer that is being
used to register MBean's.
|
String |
makeFullPath(String prefix,
String... name)
Generate a filesystem-like path.
|
protected String |
makeFullPath(String prefix,
ZKMBeanInfo bean) |
protected ObjectName |
makeObjectName(String path,
ZKMBeanInfo bean)
Builds an MBean path and creates an ObjectName instance using the path.
|
void |
register(ZKMBeanInfo bean,
ZKMBeanInfo parent)
Registers a new MBean with the platform MBean server.
|
void |
unregister(ZKMBeanInfo bean)
Unregister MBean.
|
void |
unregisterAll()
Unregister all currently registered MBeans
|
public static MBeanRegistry getInstance()
public MBeanServer getPlatformMBeanServer()
public void register(ZKMBeanInfo bean, ZKMBeanInfo parent) throws JMException
bean
- the bean being registeredparent
- if not null, the new bean will be registered as a child
node of this parent.JMException
public void unregister(ZKMBeanInfo bean)
bean
- public void unregisterAll()
public String makeFullPath(String prefix, String... name)
prefix
- path prefixname
- path elementsprotected String makeFullPath(String prefix, ZKMBeanInfo bean)
protected ObjectName makeObjectName(String path, ZKMBeanInfo bean) throws MalformedObjectNameException
path
- MBean pathbean
- the MBean instanceMalformedObjectNameException
Copyright © 2015 The Apache Software Foundation