gpt4 book ai didi

org.apache.zookeeper.jmx.ZKMBeanInfo.getName()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 22:25:31 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.zookeeper.jmx.ZKMBeanInfo.getName()方法的一些代码示例,展示了ZKMBeanInfo.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKMBeanInfo.getName()方法的具体详情如下:
包路径:org.apache.zookeeper.jmx.ZKMBeanInfo
类名称:ZKMBeanInfo
方法名:getName

ZKMBeanInfo.getName介绍

暂无

代码示例

代码示例来源:origin: apache/zookeeper

/**
 * Unregister MBean.
 * @param bean
 */
public void unregister(ZKMBeanInfo bean) {
  if(bean==null)
    return;
  String path = mapBean2Path.remove(bean);
  try {
    unregister(path,bean);
  } catch (JMException e) {
    LOG.warn("Error during unregister of [{}]", bean.getName(), e);
  } catch (Throwable t) {
    LOG.error("Unexpected exception during unregister of [{}]. It should be reviewed and fixed.", bean.getName(), t);
  }
}

代码示例来源:origin: apache/zookeeper

protected String makeFullPath(String prefix, ZKMBeanInfo bean) {
  return makeFullPath(prefix, bean == null ? null : bean.getName());
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

protected String makeFullPath(String prefix, ZKMBeanInfo bean) {
  return makeFullPath(prefix, bean == null ? null : bean.getName());
}

代码示例来源:origin: apache/zookeeper

/**
   * Builds an MBean path and creates an ObjectName instance using the path. 
   * @param path MBean path
   * @param bean the MBean instance
   * @return ObjectName to be registered with the platform MBean server
   */
  protected ObjectName makeObjectName(String path, ZKMBeanInfo bean)
    throws MalformedObjectNameException
  {
    if(path==null)
      return null;
    StringBuilder beanName = new StringBuilder(CommonNames.DOMAIN + ":");
    int counter=0;
    counter=tokenize(beanName,path,counter);
    tokenize(beanName,bean.getName(),counter);
    beanName.deleteCharAt(beanName.length()-1);
    try {
      return new ObjectName(beanName.toString());
    } catch (MalformedObjectNameException e) {
      LOG.warn("Invalid name \"" + beanName.toString() + "\" for class "
          + bean.getClass().toString());
      throw e;
    }
  }
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

/**
 * Unregister MBean.
 * @param bean
 */
public void unregister(ZKMBeanInfo bean) {
  if(bean==null)
    return;
  String path=mapBean2Path.get(bean);
  try {
    unregister(path,bean);
  } catch (JMException e) {
    LOG.warn("Error during unregister", e);
  }
  mapBean2Path.remove(bean);
  mapName2Bean.remove(bean.getName());
}
/**

代码示例来源:origin: org.apache.zookeeper/zookeeper

/**
   * Builds an MBean path and creates an ObjectName instance using the path. 
   * @param path MBean path
   * @param bean the MBean instance
   * @return ObjectName to be registered with the platform MBean server
   */
  protected ObjectName makeObjectName(String path, ZKMBeanInfo bean)
    throws MalformedObjectNameException
  {
    if(path==null)
      return null;
    StringBuilder beanName = new StringBuilder(CommonNames.DOMAIN + ":");
    int counter=0;
    counter=tokenize(beanName,path,counter);
    tokenize(beanName,bean.getName(),counter);
    beanName.deleteCharAt(beanName.length()-1);
    try {
      return new ObjectName(beanName.toString());
    } catch (MalformedObjectNameException e) {
      LOG.warn("Invalid name \"" + beanName.toString() + "\" for class "
          + bean.getClass().toString());
      throw e;
    }
  }
}

代码示例来源:origin: apache/zookeeper

/**
 * 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 {
    synchronized (LOCK) {
      mBeanServer.registerMBean(bean, oname);
      mapBean2Path.put(bean, path);
    }
  } catch (JMException e) {
    LOG.warn("Failed to register MBean " + bean.getName());
    throw e;
  }
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

/**
 * Unregister the MBean identified by the path.
 * @param path
 * @param bean
 */
private void unregister(String path,ZKMBeanInfo bean) throws JMException {
  if(path==null)
    return;
  if (!bean.isHidden()) {
    try {
      mBeanServer.unregisterMBean(makeObjectName(path, bean));
    } catch (JMException e) {
      LOG.warn("Failed to unregister MBean " + bean.getName());
      throw e;
    }
  }        
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

/**
 * 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;
  }
}

代码示例来源:origin: io.fabric8/fabric-zookeeper

protected String makeFullPath(String prefix, ZKMBeanInfo bean) {
  return makeFullPath(prefix, bean == null ? null : bean.getName());
}

代码示例来源:origin: org.apache.hadoop/zookeeper

protected String makeFullPath(String prefix, ZKMBeanInfo bean) {
  return makeFullPath(prefix, bean == null ? null : bean.getName());
}

代码示例来源:origin: org.fusesource.fabric/fabric-linkedin-zookeeper

protected String makeFullPath(String prefix, ZKMBeanInfo bean) {
  return makeFullPath(prefix, bean == null ? null : bean.getName());
}

代码示例来源:origin: jboss-fuse/fabric8

protected String makeFullPath(String prefix, ZKMBeanInfo bean) {
  return makeFullPath(prefix, bean == null ? null : bean.getName());
}

代码示例来源:origin: io.fabric8/fabric-zookeeper

/**
 * Unregister MBean.
 * @param bean
 */
public void unregister(ZKMBeanInfo bean) {
  if(bean==null)
    return;
  String path=mapBean2Path.get(bean);
  try {
    unregister(path,bean);
  } catch (JMException e) {
    LOG.warn("Error during unregister", e);
  }
  mapBean2Path.remove(bean);
  mapName2Bean.remove(bean.getName());
}
/**

代码示例来源:origin: org.apache.hadoop/zookeeper

/**
 * Unregister MBean.
 * @param bean
 */
public void unregister(ZKMBeanInfo bean) {
  if(bean==null)
    return;
  String path=mapBean2Path.get(bean);
  try {
    unregister(path,bean);
  } catch (JMException e) {
    LOG.warn("Error during unregister", e);
  }
  mapBean2Path.remove(bean);
  mapName2Bean.remove(bean.getName());
}
/**

代码示例来源:origin: org.fusesource.fabric/fabric-linkedin-zookeeper

/**
 * Unregister MBean.
 * @param bean
 */
public void unregister(ZKMBeanInfo bean) {
  if(bean==null)
    return;
  String path=mapBean2Path.get(bean);
  try {
    unregister(path,bean);
  } catch (JMException e) {
    LOG.warn("Error during unregister", e);
  }
  mapBean2Path.remove(bean);
  mapName2Bean.remove(bean.getName());
}
/**

代码示例来源:origin: org.apache.hadoop/zookeeper

/**
 * Unregister the MBean identified by the path.
 * @param path
 * @param bean
 */
private void unregister(String path,ZKMBeanInfo bean) throws JMException {
  if(path==null)
    return;
  if (!bean.isHidden()) {
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    try {
      mbs.unregisterMBean(makeObjectName(path, bean));
    } catch (JMException e) {
      LOG.warn("Failed to unregister MBean " + bean.getName());
      throw e;
    }
  }        
}

代码示例来源:origin: io.fabric8/fabric-zookeeper

/**
 * Unregister the MBean identified by the path.
 * @param path
 * @param bean
 */
private void unregister(String path,ZKMBeanInfo bean) throws JMException {
  if(path==null)
    return;
  if (!bean.isHidden()) {
    try {
      mBeanServer.unregisterMBean(makeObjectName(path, bean));
    } catch (JMException e) {
      LOG.warn("Failed to unregister MBean " + bean.getName());
      throw e;
    }
  }
}

代码示例来源:origin: jboss-fuse/fabric8

/**
 * Unregister the MBean identified by the path.
 * @param path
 * @param bean
 */
private void unregister(String path,ZKMBeanInfo bean) throws JMException {
  if(path==null)
    return;
  if (!bean.isHidden()) {
    try {
      mBeanServer.unregisterMBean(makeObjectName(path, bean));
    } catch (JMException e) {
      LOG.warn("Failed to unregister MBean " + bean.getName());
      throw e;
    }
  }        
}

代码示例来源:origin: org.fusesource.fabric/fabric-linkedin-zookeeper

/**
 * Unregister the MBean identified by the path.
 * @param path
 * @param bean
 */
private void unregister(String path,ZKMBeanInfo bean) throws JMException {
  if(path==null)
    return;
  if (!bean.isHidden()) {
    try {
      mBeanServer.unregisterMBean(makeObjectName(path, bean));
    } catch (JMException e) {
      LOG.warn("Failed to unregister MBean " + bean.getName());
      throw e;
    }
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com