Package com.sun.jmx.snmp

Examples of com.sun.jmx.snmp.SnmpOid


     **/
    protected SnmpOid getIndex(Object context, List rawDatas,
                               int rank, Object item) {
        final String key   = getKey(context,rawDatas,rank,item);
        final Object index = (names==null||key==null)?null:names.get(key);
        final SnmpOid result =
            ((index != null)?((SnmpOid)index):makeIndex(context,rawDatas,
                                                      rank,item));
        if ((context != null) && (key != null) && (result != null)) {
            Map<Object, Object> map = Util.cast(context);
            map.put(key,result);
View Full Code Here


        final Iterator it  = rawDatas.iterator();
        final TreeMap<SnmpOid, Object> map =
                new TreeMap<SnmpOid, Object>(SnmpCachedData.oidComparator);
        for (int rank=0; it.hasNext() ; rank++) {
            final Object  item  = it.next();
            final SnmpOid index = getIndex(context, rawDatas, rank, item);
            final Object  data  = getData(context, rawDatas, rank, item);
            if (index == null) continue;
            map.put(index,data);
        }
View Full Code Here

    // SnmpTableHandler.getNext()
    public final SnmpOid getNext(SnmpOid index) {
        int pos = 0;
        if (index == null) {
            if( (datas!= null) && (datas.length >= 1) )
                return new SnmpOid(0);
        }
        try {
            pos = (int) index.getOidArc(0);
        }catch(SnmpStatusException e) {
            return null;
        }

        if(pos < (datas.length - 1))
            return new SnmpOid(pos+1);
        else
            return null;
    }
View Full Code Here

            }


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

            // if next is null: we reached the end of the table.
            //
            if (next == null)
View Full Code Here

            // 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
View Full Code Here

       long id = info.getLockOwnerId();

       if(id == -1)
           return new String("0.0");

       SnmpOid oid = JvmThreadInstanceTableMetaImpl.makeOid(id);

       return getJvmThreadInstIndexOid() + "." + oid.toString();
    }
View Full Code Here

            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();
View Full Code Here

            final SnmpOid[] indexes = cached.indexes;
            final Object[]  datas   = cached.datas;
            final int len = indexes.length;
            final Map<String, SnmpOid> m = new HashMap<String, SnmpOid>(len);
            for (int i=0; i<len; i++) {
                final SnmpOid index = indexes[i];
                if (index == null) continue;
                final MemoryPoolMXBean mpm =
                    (MemoryPoolMXBean)datas[i];
                if (mpm == null) continue;
                final String name = mpm.getName();
View Full Code Here

            final String mmmName = mmm.getName();
            for (int i = 0; i < mpList.length; i++) {
                final String mpmName = mpList[i];
                if (mpmName == null) continue;
                final SnmpOid mpIndex = (SnmpOid)poolIndexMap.get(mpmName);
                if (mpIndex == null) continue;

                // The MemoryPool index is an int, so it's the first
                // and only subidentifier.
                final long mparc;
                try {
                    mparc  = mpIndex.getOidArc(0);
                } catch (SnmpStatusException x) {
                    log.debug("updateTreeMap","Bad MemoryPool OID index: " +
                          mpIndex);
                    log.debug("updateTreeMap",x);
                    continue;
                }
                // The MemoryMgrPoolRel table indexed is composed
                // of the MemoryManager index, to which the MemoryPool
                // index is appended.
                final long[] arcs = { mmarc, mparc };

                final SnmpOid index = new SnmpOid(arcs);

                table.put(index, new JvmMemMgrPoolRelEntryImpl(mmmName,
                                                               mpmName,
                                                               (int)mmarc,
                                                               (int)mparc));
View Full Code Here

                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);
View Full Code Here

TOP

Related Classes of com.sun.jmx.snmp.SnmpOid

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.