Java Code Examples for sun.management.snmp.util.JvmContextFactory#getUserData()
The following examples show how to use
sun.management.snmp.util.JvmContextFactory#getUserData() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JvmMemoryImpl.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Setter for the "JvmMemoryGCCall" variable. */ public void setJvmMemoryGCCall(EnumJvmMemoryGCCall x) throws SnmpStatusException { if (x.intValue() == JvmMemoryGCCallStart.intValue()) { final Map<Object, Object> m = JvmContextFactory.getUserData(); try { ManagementFactory.getMemoryMXBean().gc(); if (m != null) m.put("jvmMemory.getJvmMemoryGCCall", JvmMemoryGCCallStarted); } catch (Exception ex) { if (m != null) m.put("jvmMemory.getJvmMemoryGCCall", JvmMemoryGCCallFailed); } return; } throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue); }
Example 2
Source File: JvmMemoryImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * Setter for the "JvmMemoryGCCall" variable. */ public void setJvmMemoryGCCall(EnumJvmMemoryGCCall x) throws SnmpStatusException { if (x.intValue() == JvmMemoryGCCallStart.intValue()) { final Map<Object, Object> m = JvmContextFactory.getUserData(); try { ManagementFactory.getMemoryMXBean().gc(); if (m != null) m.put("jvmMemory.getJvmMemoryGCCall", JvmMemoryGCCallStarted); } catch (Exception ex) { if (m != null) m.put("jvmMemory.getJvmMemoryGCCall", JvmMemoryGCCallFailed); } return; } throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue); }
Example 3
Source File: JvmThreadInstanceTableMetaImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public Object getEntry(SnmpOid oid) throws SnmpStatusException { log.debug("*** **** **** **** getEntry", "oid [" + oid + "]"); if (oid == null || oid.getLength() != 8) { log.debug("getEntry", "Invalid oid [" + oid + "]"); throw new SnmpStatusException(SnmpStatusException.noSuchInstance); } // Get the request contextual cache (userData). // final Map<Object,Object> m = JvmContextFactory.getUserData(); // Get the handler. // SnmpTableHandler handler = getHandler(m); // handler should never be null. // if (handler == null || !handler.contains(oid)) throw new SnmpStatusException(SnmpStatusException.noSuchInstance); final JvmThreadInstanceEntryImpl entry = getJvmThreadInstance(m,oid); if (entry == null) throw new SnmpStatusException(SnmpStatusException.noSuchInstance); return entry; }
Example 4
Source File: JvmMemPoolEntryImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
MemoryUsage getMemoryUsage() { try { final Map<Object, Object> m = JvmContextFactory.getUserData(); if (m != null) { final MemoryUsage cached = (MemoryUsage) m.get(entryMemoryTag); if (cached != null) { log.debug("getMemoryUsage",entryMemoryTag+ " found in cache."); return cached; } MemoryUsage u = pool.getUsage(); if (u == null) u = ZEROS; m.put(entryMemoryTag,u); return u; } // Should never come here. // Log error! log.trace("getMemoryUsage", "ERROR: should never come here!"); return pool.getUsage(); } catch (RuntimeException x) { log.trace("getMemoryUsage", "Failed to get MemoryUsage: " + x); log.debug("getMemoryUsage",x); throw x; } }
Example 5
Source File: JvmMemPoolEntryImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
MemoryUsage getPeakMemoryUsage() { try { final Map<Object, Object> m = JvmContextFactory.getUserData(); if (m != null) { final MemoryUsage cached = (MemoryUsage) m.get(entryPeakMemoryTag); if (cached != null) { if (log.isDebugOn()) log.debug("getPeakMemoryUsage", entryPeakMemoryTag + " found in cache."); return cached; } MemoryUsage u = pool.getPeakUsage(); if (u == null) u = ZEROS; m.put(entryPeakMemoryTag,u); return u; } // Should never come here. // Log error! log.trace("getPeakMemoryUsage", "ERROR: should never come here!"); return ZEROS; } catch (RuntimeException x) { log.trace("getPeakMemoryUsage", "Failed to get MemoryUsage: " + x); log.debug("getPeakMemoryUsage",x); throw x; } }
Example 6
Source File: JvmMemoryImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
MemoryUsage getNonHeapMemoryUsage() { try { final Map<Object, Object> m = JvmContextFactory.getUserData(); if (m != null) { final MemoryUsage cached = (MemoryUsage) m.get(nonHeapMemoryTag); if (cached != null) { log.debug("getNonHeapMemoryUsage", "jvmMemory.getNonHeapMemoryUsage found in cache."); return cached; } final MemoryUsage u = getMemoryUsage(MemoryType.NON_HEAP); // getNonHeapMemoryUsage() never returns null. // // if (u == null) u=MemoryUsage.INVALID; m.put(nonHeapMemoryTag,u); return u; } // Should never come here. // Log error! log.trace("getNonHeapMemoryUsage", "ERROR: should never come here!"); return getMemoryUsage(MemoryType.NON_HEAP); } catch (RuntimeException x) { log.trace("getNonHeapMemoryUsage", "Failed to get NonHeapMemoryUsage: " + x); log.debug("getNonHeapMemoryUsage",x); throw x; } }
Example 7
Source File: JvmMemoryImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
MemoryUsage getNonHeapMemoryUsage() { try { final Map<Object, Object> m = JvmContextFactory.getUserData(); if (m != null) { final MemoryUsage cached = (MemoryUsage) m.get(nonHeapMemoryTag); if (cached != null) { log.debug("getNonHeapMemoryUsage", "jvmMemory.getNonHeapMemoryUsage found in cache."); return cached; } final MemoryUsage u = getMemoryUsage(MemoryType.NON_HEAP); // getNonHeapMemoryUsage() never returns null. // // if (u == null) u=MemoryUsage.INVALID; m.put(nonHeapMemoryTag,u); return u; } // Should never come here. // Log error! log.trace("getNonHeapMemoryUsage", "ERROR: should never come here!"); return getMemoryUsage(MemoryType.NON_HEAP); } catch (RuntimeException x) { log.trace("getNonHeapMemoryUsage", "Failed to get NonHeapMemoryUsage: " + x); log.debug("getNonHeapMemoryUsage",x); throw x; } }
Example 8
Source File: JvmMemPoolEntryImpl.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
MemoryUsage getMemoryUsage() { try { final Map<Object, Object> m = JvmContextFactory.getUserData(); if (m != null) { final MemoryUsage cached = (MemoryUsage) m.get(entryMemoryTag); if (cached != null) { log.debug("getMemoryUsage",entryMemoryTag+ " found in cache."); return cached; } MemoryUsage u = pool.getUsage(); if (u == null) u = ZEROS; m.put(entryMemoryTag,u); return u; } // Should never come here. // Log error! log.trace("getMemoryUsage", "ERROR: should never come here!"); return pool.getUsage(); } catch (RuntimeException x) { log.trace("getMemoryUsage", "Failed to get MemoryUsage: " + x); log.debug("getMemoryUsage",x); throw x; } }
Example 9
Source File: JvmThreadInstanceTableMetaImpl.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public Object getEntry(SnmpOid oid) throws SnmpStatusException { log.debug("*** **** **** **** getEntry", "oid [" + oid + "]"); if (oid == null || oid.getLength() != 8) { log.debug("getEntry", "Invalid oid [" + oid + "]"); throw new SnmpStatusException(SnmpStatusException.noSuchInstance); } // Get the request contextual cache (userData). // final Map<Object,Object> m = JvmContextFactory.getUserData(); // Get the handler. // SnmpTableHandler handler = getHandler(m); // handler should never be null. // if (handler == null || !handler.contains(oid)) throw new SnmpStatusException(SnmpStatusException.noSuchInstance); final JvmThreadInstanceEntryImpl entry = getJvmThreadInstance(m,oid); if (entry == null) throw new SnmpStatusException(SnmpStatusException.noSuchInstance); return entry; }
Example 10
Source File: JvmThreadInstanceTableMetaImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public Object getEntry(SnmpOid oid) throws SnmpStatusException { log.debug("*** **** **** **** getEntry", "oid [" + oid + "]"); if (oid == null || oid.getLength() != 8) { log.debug("getEntry", "Invalid oid [" + oid + "]"); throw new SnmpStatusException(SnmpStatusException.noSuchInstance); } // Get the request contextual cache (userData). // final Map<Object,Object> m = JvmContextFactory.getUserData(); // Get the handler. // SnmpTableHandler handler = getHandler(m); // handler should never be null. // if (handler == null || !handler.contains(oid)) throw new SnmpStatusException(SnmpStatusException.noSuchInstance); final JvmThreadInstanceEntryImpl entry = getJvmThreadInstance(m,oid); if (entry == null) throw new SnmpStatusException(SnmpStatusException.noSuchInstance); return entry; }
Example 11
Source File: JvmRTClassPathTableMetaImpl.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
/** * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>. **/ public SnmpTableHandler getTableHandler() { final Map<Object, Object> userData = JvmContextFactory.getUserData(); return getTableDatas(userData); }
Example 12
Source File: JvmRTBootClassPathTableMetaImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>. **/ public SnmpTableHandler getTableHandler() { final Map<Object,Object> userData = JvmContextFactory.getUserData(); return getTableDatas(userData); }
Example 13
Source File: JvmMemPoolTableMetaImpl.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
/** * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>. **/ public SnmpTableHandler getTableHandler() { final Map<Object, Object> userData = JvmContextFactory.getUserData(); return getTableDatas(userData); }
Example 14
Source File: JvmThreadInstanceTableMetaImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>. **/ public SnmpTableHandler getTableHandler() { final Map<Object, Object> userData = JvmContextFactory.getUserData(); return getTableDatas(userData); }
Example 15
Source File: JvmThreadInstanceTableMetaImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>. **/ public SnmpTableHandler getTableHandler() { final Map<Object, Object> userData = JvmContextFactory.getUserData(); return getTableDatas(userData); }
Example 16
Source File: JvmMemManagerTableMetaImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Call <code>getTableHandler(JvmContextFactory.getUserData())</code>. **/ public SnmpTableHandler getTableHandler() { final Map<Object, Object> userData = JvmContextFactory.getUserData(); return getTableDatas(userData); }
Example 17
Source File: JvmRTClassPathTableMetaImpl.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
/** * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>. **/ public SnmpTableHandler getTableHandler() { final Map<Object, Object> userData = JvmContextFactory.getUserData(); return getTableDatas(userData); }
Example 18
Source File: JvmRTInputArgsTableMetaImpl.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>. **/ public SnmpTableHandler getTableHandler() { final Map<Object,Object> userData = JvmContextFactory.getUserData(); return getTableDatas(userData); }
Example 19
Source File: JvmRTLibraryPathTableMetaImpl.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
/** * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>. **/ public SnmpTableHandler getTableHandler() { final Map<Object,Object> userData = JvmContextFactory.getUserData(); return getTableDatas(userData); }
Example 20
Source File: JvmMemPoolTableMetaImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>. **/ public SnmpTableHandler getTableHandler() { final Map<Object, Object> userData = JvmContextFactory.getUserData(); return getTableDatas(userData); }