Search in sources :

Example 36 with SnmpOid

use of com.sun.jmx.snmp.SnmpOid in project jdk8u_jdk by JetBrains.

the class JvmMemPoolTableMetaImpl method getNextOid.

// See com.sun.jmx.snmp.agent.SnmpMibTable
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) {
            //
            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 == 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;
    }
}
Also used : SnmpStatusException(com.sun.jmx.snmp.SnmpStatusException) SnmpOid(com.sun.jmx.snmp.SnmpOid) SnmpTableHandler(sun.management.snmp.util.SnmpTableHandler)

Example 37 with SnmpOid

use of com.sun.jmx.snmp.SnmpOid in project jdk8u_jdk by JetBrains.

the class JvmMemGCTableMetaImpl method getNextOid.

// See com.sun.jmx.snmp.agent.SnmpMibTable
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) {
            //
            if (dbg)
                log.debug("getNextOid", "handler is null!");
            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
        }
        // Get the next oid, using the GC filter.
        //
        final SnmpOid next = filter.getNext(handler, oid);
        if (dbg)
            log.debug("getNextOid", "next=" + next);
        //
        if (next == null)
            throw new SnmpStatusException(SnmpStatusException.noSuchInstance);
        return next;
    } catch (RuntimeException x) {
        //
        if (dbg)
            log.debug("getNextOid", x);
        throw x;
    }
}
Also used : SnmpStatusException(com.sun.jmx.snmp.SnmpStatusException) SnmpOid(com.sun.jmx.snmp.SnmpOid) SnmpTableHandler(sun.management.snmp.util.SnmpTableHandler)

Aggregations

SnmpOid (com.sun.jmx.snmp.SnmpOid)37 SnmpStatusException (com.sun.jmx.snmp.SnmpStatusException)15 SnmpTableHandler (sun.management.snmp.util.SnmpTableHandler)9 SnmpVarBind (com.sun.jmx.snmp.SnmpVarBind)4 SnmpValue (com.sun.jmx.snmp.SnmpValue)3 SnmpMibAgent (com.sun.jmx.snmp.agent.SnmpMibAgent)2 TreeMap (java.util.TreeMap)2 ObjectName (javax.management.ObjectName)2 Date (java.util.Date)1 Map (java.util.Map)1