本文整理汇总了Java中sun.management.snmp.util.SnmpCachedData.oidComparator方法的典型用法代码示例。如果您正苦于以下问题:Java SnmpCachedData.oidComparator方法的具体用法?Java SnmpCachedData.oidComparator怎么用?Java SnmpCachedData.oidComparator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.management.snmp.util.SnmpCachedData
的用法示例。
在下文中一共展示了SnmpCachedData.oidComparator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateCachedDatas
import sun.management.snmp.util.SnmpCachedData; //导入方法依赖的package包/类
/**
* Return a table handler containing the Thread indexes.
* Indexes are computed from the ThreadId.
**/
protected SnmpCachedData updateCachedDatas(Object userData) {
// We are getting all the thread ids. WARNING.
// Some of them will be not valid when accessed for data...
// See getEntry
long[] id = JvmThreadingImpl.getThreadMXBean().getAllThreadIds();
// Time stamp for the cache
final long time = System.currentTimeMillis();
SnmpOid indexes[] = new SnmpOid[id.length];
final TreeMap<SnmpOid, Object> table =
new TreeMap<>(SnmpCachedData.oidComparator);
for(int i = 0; i < id.length; i++) {
log.debug("", "Making index for thread id [" + id[i] +"]");
//indexes[i] = makeOid(id[i]);
SnmpOid oid = makeOid(id[i]);
table.put(oid, oid);
}
return new SnmpCachedData(time, table);
}
示例2: updateCachedDatas
import sun.management.snmp.util.SnmpCachedData; //导入方法依赖的package包/类
/**
* Return a table handler that holds the jvmMemManagerTable table data.
* This method return the cached table data if it is still
* valid, recompute it and cache the new value if it's not.
* If it needs to recompute the cached data, it first
* try to obtain the list of memory managers from the request
* contextual cache, and if it is not found, it calls
* <code>ManagementFactory.getMemoryMBean().getMemoryManagers()</code>
* and caches the value.
* This ensures that
* <code>ManagementFactory.getMemoryMBean().getMemoryManagers()</code>
* is not called more than once per request, thus ensuring a
* consistent view of the table.
**/
protected SnmpCachedData updateCachedDatas(Object userData) {
// Get the MemoryManager table
final SnmpTableHandler mmHandler =
meta.getManagerHandler(userData);
// Get the MemoryPool table
final SnmpTableHandler mpHandler =
meta.getPoolHandler(userData);
// Time stamp for the cache
final long time = System.currentTimeMillis();
// Build a Map poolname -> index
final Map<String,SnmpOid> poolIndexMap = buildPoolIndexMap(mpHandler);
// For each memory manager, get the list of memory pools
// For each memory pool, find its index in the memory pool table
// Create a row in the relation table.
final TreeMap<SnmpOid, Object> table =
new TreeMap<>(SnmpCachedData.oidComparator);
updateTreeMap(table,userData,mmHandler,mpHandler,poolIndexMap);
return new SnmpCachedData(time,table);
}
示例3: updateCachedDatas
import sun.management.snmp.util.SnmpCachedData; //导入方法依赖的package包/类
/**
* Return a table handler containing the Thread indexes.
* Indexes are computed from the ThreadId.
**/
protected SnmpCachedData updateCachedDatas(Object userData) {
// We are getting all the thread ids. WARNING.
// Some of them will be not valid when accessed for data...
// See getEntry
long[] id = JvmThreadingImpl.getThreadMXBean().getAllThreadIds();
// Time stamp for the cache
final long time = System.currentTimeMillis();
SnmpOid indexes[] = new SnmpOid[id.length];
final TreeMap<SnmpOid, Object> table =
new TreeMap<SnmpOid, Object>(SnmpCachedData.oidComparator);
for(int i = 0; i < id.length; i++) {
log.debug("", "Making index for thread id [" + id[i] +"]");
//indexes[i] = makeOid(id[i]);
SnmpOid oid = makeOid(id[i]);
table.put(oid, oid);
}
return new SnmpCachedData(time, table);
}
示例4: updateCachedDatas
import sun.management.snmp.util.SnmpCachedData; //导入方法依赖的package包/类
/**
* Return a table handler that holds the jvmMemManagerTable table data.
* This method return the cached table data if it is still
* valid, recompute it and cache the new value if it's not.
* If it needs to recompute the cached data, it first
* try to obtain the list of memory managers from the request
* contextual cache, and if it is not found, it calls
* <code>ManagementFactory.getMemoryMBean().getMemoryManagers()</code>
* and caches the value.
* This ensures that
* <code>ManagementFactory.getMemoryMBean().getMemoryManagers()</code>
* is not called more than once per request, thus ensuring a
* consistent view of the table.
**/
protected SnmpCachedData updateCachedDatas(Object userData) {
// Get the MemoryManager table
final SnmpTableHandler mmHandler =
meta.getManagerHandler(userData);
// Get the MemoryPool table
final SnmpTableHandler mpHandler =
meta.getPoolHandler(userData);
// Time stamp for the cache
final long time = System.currentTimeMillis();
// Build a Map poolname -> index
final Map poolIndexMap = buildPoolIndexMap(mpHandler);
// For each memory manager, get the list of memory pools
// For each memory pool, find its index in the memory pool table
// Create a row in the relation table.
final TreeMap<SnmpOid, Object> table =
new TreeMap<SnmpOid, Object>(SnmpCachedData.oidComparator);
updateTreeMap(table,userData,mmHandler,mpHandler,poolIndexMap);
return new SnmpCachedData(time,table);
}