MbeansSource.java 文件源码

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

项目:lazycat 作者:
private void processAttribute(MBeanServer server, Node descN, String objectName) {
    String attName = DomUtil.getAttribute(descN, "name");
    String value = DomUtil.getAttribute(descN, "value");
    String type = null; // DomUtil.getAttribute(descN, "type");
    if (value == null) {
        // The value may be specified as CDATA
        value = DomUtil.getContent(descN);
    }
    try {
        if (log.isDebugEnabled())
            log.debug("Set attribute " + objectName + " " + attName + " " + value);
        ObjectName oname = new ObjectName(objectName);
        // find the type
        type = registry.getType(oname, attName);

        if (type == null) {
            log.info("Can't find attribute " + objectName + " " + attName);

        } else {
            Object valueO = registry.convertValue(type, value);
            server.setAttribute(oname, new Attribute(attName, valueO));
        }
    } catch (Exception ex) {
        log.error("Error processing attribute " + objectName + " " + attName + " " + value, ex);
    }

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号