JMXAccessorSetTask.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:lams 作者:
/**
 * Get MBean Attriute from Mbean Server
 * @param jmxServerConnection
 * @param name
 * @param attribute
 * @return The type
 * @throws Exception
 */
protected String getMBeanAttributeType(
        MBeanServerConnection jmxServerConnection,
        String name,
        String attribute) throws Exception {
    ObjectName oname = new ObjectName(name);
    String mattrType = null;
    MBeanInfo minfo = jmxServerConnection.getMBeanInfo(oname);
    MBeanAttributeInfo attrs[] = minfo.getAttributes();
    if (attrs != null) {
        for (int i = 0; mattrType == null && i < attrs.length; i++) {
            if (attribute.equals(attrs[i].getName()))
                mattrType = attrs[i].getType();
        }
    }
    return mattrType;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号