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


Java SnmpTableHandler.getData方法代码示例

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


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

示例1: getNext

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
/**
 * Returns the index that immediately follows the given
 * <var>index</var>. The returned index is strictly greater
 * than the given <var>index</var>, and is contained in the table.
 * <br>If the given <var>index</var> is null, returns the first
 * index in the table.
 * <br>If there are no index after the given <var>index</var>,
 * returns null.
 **/
public SnmpOid getNext(SnmpTableHandler handler, SnmpOid index) {

    // try to call the optimized method
    if (handler instanceof SnmpCachedData)
        return getNext((SnmpCachedData)handler, index);

    // too bad - revert to non-optimized generic algorithm
    SnmpOid next = index;
    do {
        next = handler.getNext(next);
        final Object value = handler.getData(next);
        if (value instanceof GarbageCollectorMXBean)
            // That's the next! return it
            return next;
        // skip to next index...
    } while (next != null);
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:JvmMemGCTableMetaImpl.java

示例2: buildPoolIndexMap

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
/**
 * Builds a map pool-name => pool-index from the SnmpTableHandler
 * of the JvmMemPoolTable.
 **/
private static Map<String, SnmpOid> buildPoolIndexMap(SnmpTableHandler handler) {
    // optimization...
    if (handler instanceof SnmpCachedData)
        return buildPoolIndexMap((SnmpCachedData)handler);

    // not optimizable... too bad.
    final Map<String, SnmpOid> m = new HashMap<>();
    SnmpOid index=null;
    while ((index = handler.getNext(index))!=null) {
        final MemoryPoolMXBean mpm =
            (MemoryPoolMXBean)handler.getData(index);
        if (mpm == null) continue;
        final String name = mpm.getName();
        if (name == null) continue;
        m.put(name,index);
    }
    return m;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:JvmMemMgrPoolRelTableMetaImpl.java

示例3: updateTreeMap

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
protected void updateTreeMap(TreeMap<SnmpOid, Object> table, Object userData,
                             SnmpTableHandler mmHandler,
                             SnmpTableHandler mpHandler,
                             Map<String, SnmpOid> poolIndexMap) {
    if (mmHandler instanceof SnmpCachedData) {
        updateTreeMap(table,userData,(SnmpCachedData)mmHandler,
                      mpHandler,poolIndexMap);
        return;
    }

    SnmpOid mmIndex=null;
    while ((mmIndex = mmHandler.getNext(mmIndex))!=null) {
        final MemoryManagerMXBean mmm =
            (MemoryManagerMXBean)mmHandler.getData(mmIndex);
        if (mmm == null) continue;
        updateTreeMap(table,userData,mmm,mmIndex,poolIndexMap);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:JvmMemMgrPoolRelTableMetaImpl.java

示例4: buildPoolIndexMap

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
/**
 * Builds a map pool-name => pool-index from the SnmpTableHandler
 * of the JvmMemPoolTable.
 **/
private static Map<String, SnmpOid> buildPoolIndexMap(SnmpTableHandler handler) {
    // optimization...
    if (handler instanceof SnmpCachedData)
        return buildPoolIndexMap((SnmpCachedData)handler);

    // not optimizable... too bad.
    final Map<String, SnmpOid> m = new HashMap<String, SnmpOid>();
    SnmpOid index=null;
    while ((index = handler.getNext(index))!=null) {
        final MemoryPoolMXBean mpm =
            (MemoryPoolMXBean)handler.getData(index);
        if (mpm == null) continue;
        final String name = mpm.getName();
        if (name == null) continue;
        m.put(name,index);
    }
    return m;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:23,代码来源:JvmMemMgrPoolRelTableMetaImpl.java

示例5: updateTreeMap

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
protected void updateTreeMap(TreeMap<SnmpOid, Object> table, Object userData,
                             SnmpTableHandler mmHandler,
                             SnmpTableHandler mpHandler,
                             Map poolIndexMap) {
    if (mmHandler instanceof SnmpCachedData) {
        updateTreeMap(table,userData,(SnmpCachedData)mmHandler,
                      mpHandler,poolIndexMap);
        return;
    }

    SnmpOid mmIndex=null;
    while ((mmIndex = mmHandler.getNext(mmIndex))!=null) {
        final MemoryManagerMXBean mmm =
            (MemoryManagerMXBean)mmHandler.getData(mmIndex);
        if (mmm == null) continue;
        updateTreeMap(table,userData,mmm,mmIndex,poolIndexMap);
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:19,代码来源:JvmMemMgrPoolRelTableMetaImpl.java

示例6: getData

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
/**
 * Returns the data associated with the given index.
 * If the given index is not found, null is returned.
 * Note that returning null does not necessarily means that
 * the index was not found.
 **/
public Object  getData(SnmpTableHandler handler, SnmpOid index) {
    final Object value = handler.getData(index);
    if (value instanceof GarbageCollectorMXBean) return value;
    // Behaves as if there was nothing at this index...
    //
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:JvmMemGCTableMetaImpl.java

示例7: contains

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
/**
 * Returns true if the given <var>index</var> is present.
 **/
public boolean contains(SnmpTableHandler handler, SnmpOid index) {
    if (handler.getData(index) instanceof GarbageCollectorMXBean)
        return true;
    // Behaves as if there was nothing at this index...
    //
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:JvmMemGCTableMetaImpl.java


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