/**
* Registers a new MBean with the platform MBean server.
* @param bean the bean being registered
* @param parent if not null, the new bean will be registered as a child
* node of this parent.
*/
public void register(ZKMBeanInfo bean, ZKMBeanInfo parent)
throws JMException
{
assert bean != null;
String path = null;
if (parent != null) {
path = mapBean2Path.get(parent);
assert path != null;
}
path = makeFullPath(path, parent);
if(bean.isHidden())
return;
ObjectName oname = makeObjectName(path, bean);
try {
mBeanServer.registerMBean(bean, oname);
mapBean2Path.put(bean, path);
mapName2Bean.put(bean.getName(), bean);
} catch (JMException e) {
LOG.warn("Failed to register MBean " + bean.getName());
throw e;
}
}
MBeanRegistry.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:ZooKeeper
作者:
评论列表
文章目录