本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}