jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolTableMetaImpl.java
changeset 11530 a9d059c15b80
parent 5506 202f599c92aa
child 14342 8435a30053c1
equal deleted inserted replaced
11529:e08d565262ce 11530:a9d059c15b80
    59 /**
    59 /**
    60  * The class is used for implementing the "JvmMemPoolTable" group.
    60  * The class is used for implementing the "JvmMemPoolTable" group.
    61  */
    61  */
    62 public class JvmMemPoolTableMetaImpl extends JvmMemPoolTableMeta {
    62 public class JvmMemPoolTableMetaImpl extends JvmMemPoolTableMeta {
    63 
    63 
       
    64     static final long serialVersionUID = -2525820976094284957L;
       
    65 
    64     /**
    66     /**
    65      * A concrete implementation of {@link SnmpNamedListTableCache}, for the
    67      * A concrete implementation of {@link SnmpNamedListTableCache}, for the
    66      * jvmMemPoolTable.
    68      * jvmMemPoolTable.
    67      **/
    69      **/
    68     private static class JvmMemPoolTableCache extends SnmpNamedListTableCache {
    70     private static class JvmMemPoolTableCache extends SnmpNamedListTableCache {
       
    71 
       
    72         static final long serialVersionUID = -1755520683086760574L;
       
    73 
    69         /**
    74         /**
    70          * Create a weak cache for the jvmMemPoolTable.
    75          * Create a weak cache for the jvmMemPoolTable.
    71          * @param validity validity of the cached data, in ms.
    76          * @param validity validity of the cached data, in ms.
    72          **/
    77          **/
    73         JvmMemPoolTableCache(long validity) {
    78         JvmMemPoolTableCache(long validity) {
    84          * @param rank The <var>rank</var> of <var>item</var> in the list.
    89          * @param rank The <var>rank</var> of <var>item</var> in the list.
    85          * @param item The <var>rank</var><super>th</super>
    90          * @param item The <var>rank</var><super>th</super>
    86          *        <code>MemoryPoolMXBean</code> in the list.
    91          *        <code>MemoryPoolMXBean</code> in the list.
    87          * @return  <code>((MemoryPoolMXBean)item).getName()</code>
    92          * @return  <code>((MemoryPoolMXBean)item).getName()</code>
    88          **/
    93          **/
    89         protected String getKey(Object context, List rawDatas,
    94         protected String getKey(Object context, List<?> rawDatas,
    90                                 int rank, Object item) {
    95                                 int rank, Object item) {
    91             if (item == null) return null;
    96             if (item == null) return null;
    92             final String name = ((MemoryPoolMXBean)item).getName();
    97             final String name = ((MemoryPoolMXBean)item).getName();
    93             log.debug("getKey", "key=" + name);
    98             log.debug("getKey", "key=" + name);
    94             return name;
    99             return name;
    96 
   101 
    97         /**
   102         /**
    98          * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>.
   103          * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>.
    99          **/
   104          **/
   100         public SnmpTableHandler getTableHandler() {
   105         public SnmpTableHandler getTableHandler() {
   101             final Map userData = JvmContextFactory.getUserData();
   106             final Map<Object, Object> userData = JvmContextFactory.getUserData();
   102             return getTableDatas(userData);
   107             return getTableDatas(userData);
   103         }
   108         }
   104 
   109 
   105         /**
   110         /**
   106          * Return the key used to cache the raw data of this table.
   111          * Return the key used to cache the raw data of this table.
   111 
   116 
   112         /**
   117         /**
   113          * Call ManagementFactory.getMemoryPoolMXBeans() to
   118          * Call ManagementFactory.getMemoryPoolMXBeans() to
   114          * load the raw data of this table.
   119          * load the raw data of this table.
   115          **/
   120          **/
   116         protected List   loadRawDatas(Map userData) {
   121         protected List<MemoryPoolMXBean> loadRawDatas(Map<Object, Object> userData) {
   117             return ManagementFactory.getMemoryPoolMXBeans();
   122             return ManagementFactory.getMemoryPoolMXBeans();
   118         }
   123         }
   119     }
   124     }
   120 
   125 
   121     // The weak cache for this table.
   126     // The weak cache for this table.