当前位置: 首页>>代码示例>>Java>>正文


Java ObjectName.getKeyPropertyListString方法代码示例

本文整理汇总了Java中javax.management.ObjectName.getKeyPropertyListString方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectName.getKeyPropertyListString方法的具体用法?Java ObjectName.getKeyPropertyListString怎么用?Java ObjectName.getKeyPropertyListString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.management.ObjectName的用法示例。


在下文中一共展示了ObjectName.getKeyPropertyListString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getKeyPropertyList

import javax.management.ObjectName; //导入方法依赖的package包/类
static LinkedHashMap<String, String> getKeyPropertyList(ObjectName mbeanName) {
    // Implement a version of ObjectName.getKeyPropertyList that returns the
    // properties in the ordered they were added (the ObjectName stores them
    // in the order they were added).
    LinkedHashMap<String, String> output = new LinkedHashMap<String, String>();
    String properties = mbeanName.getKeyPropertyListString();
    Matcher match = PROPERTY_PATTERN.matcher(properties);
    while (match.lookingAt()) {
        output.put(match.group(1), match.group(2));
        properties = properties.substring(match.end());
        if (properties.startsWith(",")) {
            properties = properties.substring(1);
        }
        match.reset(properties);
    }
    return output;
}
 
开发者ID:flokkr,项目名称:jmxpromo,代码行数:18,代码来源:JmxScraper.java

示例2: initChildObjectNameParts

import javax.management.ObjectName; //导入方法依赖的package包/类
/**
 * TODO: Comment.
 * 
 */
private void initChildObjectNameParts() {

    _ChildObjectNameKeyValues = new ArrayList<ObjectNameKeyValue>();
    _ObjectNameKeyValueMap = new HashMap<String, ObjectNameKeyValue>();
    _MBeanObjectNameKeyValueMap = new HashMap<ObjectName, ObjectNameKeyValue>();

    if (_MBeanObjectNames == null) {
        return;
    }

    for (ObjectName objectName : _MBeanObjectNames) {

        ObjectNameKeyValue parentObjectNameKeyValue = null;
        String keyPropertyListString = objectName.getKeyPropertyListString();
        String[] keyValuePairStrings = keyPropertyListString.split(",");
        int keyValuePairCount = keyValuePairStrings.length;
        for (int i = 0; i < keyValuePairCount; i++) {

            String keyValuePairString = keyValuePairStrings[i];

            String[] keyValuePair = keyValuePairString.split("=");
            String key = keyValuePair[0];

            if (_ObjectNameKeyValueMap.containsKey(keyValuePairString)) {
                parentObjectNameKeyValue = _ObjectNameKeyValueMap.get(keyValuePairString);
                continue;
            }

            boolean isMBean = false;
            if (i == keyValuePairCount - 1) {
                isMBean = true;
            }

            IObjectNamePart parentObjectNamePart = this;
            List<ObjectNameKeyValue> childParts = _ChildObjectNameKeyValues;
            if (parentObjectNameKeyValue != null) {
                parentObjectNamePart = parentObjectNameKeyValue;
                childParts = parentObjectNameKeyValue.getChildObjectNameKeyValues();
            }

            ObjectNameKeyValue objectNameKeyValue = new ObjectNameKeyValue(objectName, isMBean, key,
                    parentObjectNamePart);
            childParts.add(objectNameKeyValue);

            _ObjectNameKeyValueMap.put(keyValuePairString, objectNameKeyValue);
            if (isMBean) {
                _MBeanObjectNameKeyValueMap.put(objectName, objectNameKeyValue);
            }
            parentObjectNameKeyValue = objectNameKeyValue;

        }

    }

}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:60,代码来源:Domain.java


注:本文中的javax.management.ObjectName.getKeyPropertyListString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。