use of sun.management.snmp.util.SnmpTableHandler in project jdk8u_jdk by JetBrains.
the class JvmRTBootClassPathTableMetaImpl method getHandler.
/**
* Get the SnmpTableHandler that holds the jvmThreadInstanceTable data.
* First look it up in the request contextual cache, and if it is
* not found, obtain it from the weak cache.
* <br>The request contextual cache will be released at the end of the
* current requests, and is used only to process this request.
* <br>The weak cache is shared by all requests, and is only
* recomputed when it is found to be obsolete.
* <br>Note that the data put in the request contextual cache is
* never considered to be obsolete, in order to preserve data
* coherency.
**/
protected SnmpTableHandler getHandler(Object userData) {
final Map<Object, Object> m;
if (userData instanceof Map)
m = Util.cast(userData);
else
m = null;
// Look in the contextual cache.
if (m != null) {
final SnmpTableHandler handler = (SnmpTableHandler) m.get("JvmRTBootClassPathTable.handler");
if (handler != null)
return handler;
}
// No handler in contextual cache, make a new one.
final SnmpTableHandler handler = cache.getTableHandler();
if (m != null && handler != null)
m.put("JvmRTBootClassPathTable.handler", handler);
return handler;
}
use of sun.management.snmp.util.SnmpTableHandler in project jdk8u_jdk by JetBrains.
the class JvmRTClassPathTableMetaImpl method getHandler.
/**
* Get the SnmpTableHandler that holds the jvmThreadInstanceTable data.
* First look it up in the request contextual cache, and if it is
* not found, obtain it from the weak cache.
* <br>The request contextual cache will be released at the end of the
* current requests, and is used only to process this request.
* <br>The weak cache is shared by all requests, and is only
* recomputed when it is found to be obsolete.
* <br>Note that the data put in the request contextual cache is
* never considered to be obsolete, in order to preserve data
* coherency.
**/
protected SnmpTableHandler getHandler(Object userData) {
final Map<Object, Object> m;
if (userData instanceof Map)
m = Util.cast(userData);
else
m = null;
// Look in the contextual cache.
if (m != null) {
final SnmpTableHandler handler = (SnmpTableHandler) m.get("JvmRTClassPathTable.handler");
if (handler != null)
return handler;
}
// No handler in contextual cache, make a new one.
final SnmpTableHandler handler = cache.getTableHandler();
if (m != null && handler != null)
m.put("JvmRTClassPathTable.handler", handler);
return handler;
}
use of sun.management.snmp.util.SnmpTableHandler in project jdk8u_jdk by JetBrains.
the class JvmRTInputArgsTableMetaImpl method getEntry.
// See com.sun.jmx.snmp.agent.SnmpMibTable
public Object getEntry(SnmpOid oid) throws SnmpStatusException {
final boolean dbg = log.isDebugOn();
if (dbg)
log.debug("getEntry", "oid [" + oid + "]");
if (oid == null || oid.getLength() != 1) {
if (dbg)
log.debug("getEntry", "Invalid oid [" + oid + "]");
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
}
// Get the request contextual cache (userData).
//
final Map<Object, Object> m = JvmContextFactory.getUserData();
// We're going to use this name to store/retrieve the entry in
// the request contextual cache.
//
// Revisit: Probably better programming to put all these strings
// in some interface.
//
final String entryTag = ((m == null) ? null : ("JvmRTInputArgsTable.entry." + oid.toString()));
//
if (m != null) {
final Object entry = m.get(entryTag);
if (entry != null) {
if (dbg)
log.debug("getEntry", "Entry is already in the cache");
return entry;
} else if (dbg)
log.debug("getEntry", "Entry is not in the cache");
}
// The entry was not in the cache, make a new one.
//
// Get the data hanler.
//
SnmpTableHandler handler = getHandler(m);
//
if (handler == null)
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
// Get the data associated with our entry.
//
final Object data = handler.getData(oid);
//
if (data == null)
throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
//
if (dbg)
log.debug("getEntry", "data is a: " + data.getClass().getName());
final Object entry = new JvmRTInputArgsEntryImpl((String) data, (int) oid.getOidArc(0));
//
if (m != null && entry != null) {
m.put(entryTag, entry);
}
return entry;
}
use of sun.management.snmp.util.SnmpTableHandler in project jdk8u_jdk by JetBrains.
the class JvmMemPoolTableMetaImpl method getHandler.
/**
* Get the SnmpTableHandler that holds the jvmMemPoolTable data.
* First look it up in the request contextual cache, and if it is
* not found, obtain it from the weak cache.
* <br>The request contextual cache will be released at the end of the
* current requests, and is used only to process this request.
* <br>The weak cache is shared by all requests, and is only
* recomputed when it is found to be obsolete.
* <br>Note that the data put in the request contextual cache is
* never considered to be obsolete, in order to preserve data
* coherency.
**/
protected SnmpTableHandler getHandler(Object userData) {
final Map<Object, Object> m;
if (userData instanceof Map)
m = Util.cast(userData);
else
m = null;
// Look in the contextual cache.
if (m != null) {
final SnmpTableHandler handler = (SnmpTableHandler) m.get("JvmMemPoolTable.handler");
if (handler != null)
return handler;
}
// No handler in contextual cache, make a new one.
final SnmpTableHandler handler = cache.getTableHandler();
if (m != null && handler != null)
m.put("JvmMemPoolTable.handler", handler);
return handler;
}
use of sun.management.snmp.util.SnmpTableHandler in project jdk8u_jdk by JetBrains.
the class JvmRTInputArgsTableMetaImpl method getHandler.
/**
* Get the SnmpTableHandler that holds the jvmThreadInstanceTable data.
* First look it up in the request contextual cache, and if it is
* not found, obtain it from the weak cache.
* <br>The request contextual cache will be released at the end of the
* current requests, and is used only to process this request.
* <br>The weak cache is shared by all requests, and is only
* recomputed when it is found to be obsolete.
* <br>Note that the data put in the request contextual cache is
* never considered to be obsolete, in order to preserve data
* coherency.
**/
protected SnmpTableHandler getHandler(Object userData) {
final Map<Object, Object> m;
if (userData instanceof Map)
m = Util.cast(userData);
else
m = null;
// Look in the contextual cache.
if (m != null) {
final SnmpTableHandler handler = (SnmpTableHandler) m.get("JvmRTInputArgsTable.handler");
if (handler != null)
return handler;
}
// No handler in contextual cache, make a new one.
final SnmpTableHandler handler = cache.getTableHandler();
if (m != null && handler != null)
m.put("JvmRTInputArgsTable.handler", handler);
return handler;
}
Aggregations