Registry.java 文件源码

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

项目:lazycat 作者:
/**
 * Get the type of an attribute of the object, from the metadata.
 *
 * @param oname
 * @param attName
 * @return null if metadata about the attribute is not found
 * @since 1.1
 */
public String getType(ObjectName oname, String attName) {
    String type = null;
    MBeanInfo info = null;
    try {
        info = server.getMBeanInfo(oname);
    } catch (Exception e) {
        log.info("Can't find metadata for object" + oname);
        return null;
    }

    MBeanAttributeInfo attInfo[] = info.getAttributes();
    for (int i = 0; i < attInfo.length; i++) {
        if (attName.equals(attInfo[i].getName())) {
            type = attInfo[i].getType();
            return type;
        }
    }
    return null;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号