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


Java SnmpTableHandler.getNext方法代码示例

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


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

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
protected SnmpOid getNextOid(SnmpOid oid, Object userData)
    throws SnmpStatusException {
    final boolean dbg = log.isDebugOn();
    if (dbg) log.debug("getNextOid", "previous=" + oid);


    // Get the data handler.
    //
    SnmpTableHandler handler = getHandler(userData);
    if (handler == null) {
        // This should never happen.
        // If we get here it's a bug.
        //
        if (dbg) log.debug("getNextOid", "handler is null!");
        throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
    }

    // Get the next oid
    //
    final SnmpOid next = handler.getNext(oid);
    if (dbg) log.debug("*** **** **** **** getNextOid", "next=" + next);

    // if next is null: we reached the end of the table.
    //
    if (next == null)
        throw new SnmpStatusException(SnmpStatusException.noSuchInstance);

    return next;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:JvmRTInputArgsTableMetaImpl.java

示例6: getNextOid

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
protected SnmpOid getNextOid(SnmpOid oid, Object userData)
    throws SnmpStatusException {
    final boolean dbg = log.isDebugOn();
    if (dbg) log.debug("getNextOid", "previous=" + oid);


    // Get the data handler.
    //
    SnmpTableHandler handler = getHandler(userData);
    if (handler == null) {
        // This should never happen.
        // If we get here it's a bug.
        //
        if (dbg) log.debug("getNextOid", "handler is null!");
        throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
    }

    // Get the next oid
    //
    final SnmpOid next = handler.getNext(oid);
    if (dbg) log.debug("getNextOid", "next=" + next);

    // if next is null: we reached the end of the table.
    //
    if (next == null)
        throw new SnmpStatusException(SnmpStatusException.noSuchInstance);

    return next;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:JvmMemManagerTableMetaImpl.java

示例7: getNextOid

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
protected SnmpOid getNextOid(SnmpOid oid, Object userData)
    throws SnmpStatusException {
    log.debug("getNextOid", "previous=" + oid);


    // Get the data handler.
    //
    SnmpTableHandler handler = getHandler(userData);
    if (handler == null) {
        // This should never happen.
        // If we get here it's a bug.
        //
        log.debug("getNextOid", "handler is null!");
        throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
    }

    // Get the next oid
    //
    SnmpOid next = oid;
    while(true) {
        next = handler.getNext(next);
        if (next == null) break;
        if (getJvmThreadInstance(userData,next) != null) break;
    }

    log.debug("*** **** **** **** getNextOid", "next=" + next);

    // if next is null: we reached the end of the table.
    //
    if (next == null)
        throw new SnmpStatusException(SnmpStatusException.noSuchInstance);

    return next;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:JvmThreadInstanceTableMetaImpl.java

示例8: getNextOid

import sun.management.snmp.util.SnmpTableHandler; //导入方法依赖的package包/类
protected SnmpOid getNextOid(SnmpOid oid, Object userData)
    throws SnmpStatusException {
    final boolean dbg = log.isDebugOn();
    try {
        if (dbg) log.debug("getNextOid", "previous=" + oid);


        // Get the data handler.
        //
        SnmpTableHandler handler = getHandler(userData);
        if (handler == null) {
            // This should never happen.
            // If we get here it's a bug.
            //
            if (dbg) log.debug("getNextOid", "handler is null!");
            throw new
                SnmpStatusException(SnmpStatusException.noSuchInstance);
        }

        // Get the next oid
        //
        final SnmpOid next = handler.getNext(oid);
        if (dbg) log.debug("getNextOid", "next=" + next);

        // if next is null: we reached the end of the table.
        //
        if (next == null)
            throw new
                SnmpStatusException(SnmpStatusException.noSuchInstance);

        return next;
    } catch (SnmpStatusException x) {
        if (dbg) log.debug("getNextOid", "End of MIB View: " + x);
        throw x;
    } catch (RuntimeException r) {
        if (dbg) log.debug("getNextOid", "Unexpected exception: " + r);
        if (dbg) log.debug("getNextOid",r);
        throw r;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:JvmMemPoolTableMetaImpl.java


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