2362N/A * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The class is used for implementing the "JvmMemPoolTable" group. 0N/A * A concrete implementation of {@link SnmpNamedListTableCache}, for the 0N/A * Create a weak cache for the jvmMemPoolTable. 0N/A * @param validity validity of the cached data, in ms. 0N/A * Use the MemoryPoolMXBean name as key. 0N/A * @param context A {@link TreeMap} as allocated by the parent 0N/A * {@link SnmpNamedListTableCache} class. 0N/A * @param rawDatas List of {@link MemoryPoolMXBean}, as 0N/A * <code>ManagementFactory.getMemoryPoolMXBeans()</code> 0N/A * @param rank The <var>rank</var> of <var>item</var> in the list. 0N/A * @param item The <var>rank</var><super>th</super> 0N/A * <code>MemoryPoolMXBean</code> in the list. 0N/A * @return <code>((MemoryPoolMXBean)item).getName()</code> 0N/A * Call <code>getTableDatas(JvmContextFactory.getUserData())</code>. 0N/A * Return the key used to cache the raw data of this table. 0N/A return "JvmMemManagerTable.getMemoryPools";
0N/A * Call ManagementFactory.getMemoryPoolMXBeans() to 0N/A * load the raw data of this table. 0N/A // The weak cache for this table. 0N/A * Constructor for the table. 0N/A * Initialize metadata for "JvmMemPoolTableMeta". 0N/A // See com.sun.jmx.snmp.agent.SnmpMibTable 0N/A // null means get the first OID. 0N/A // See com.sun.jmx.snmp.agent.SnmpMibTable 0N/A // Get the data handler. 0N/A // This should never happen. 0N/A // If we get here it's a bug. 0N/A // if next is null: we reached the end of the table. 0N/A // See com.sun.jmx.snmp.agent.SnmpMibTable 0N/A // handler should never be null. 0N/A // See com.sun.jmx.snmp.agent.SnmpMibTable 0N/A // Get the request contextual cache (userData). 0N/A // We know in the case of this table that the index is an integer, 0N/A // it is thus the first OID arc of the index OID. 0N/A // the request contextual cache. 0N/A // Revisit: Probably better programming to put all these strings 0N/A // in some interface. 0N/A // If the entry is in the cache, simply return it. 0N/A // The entry was not in the cache, make a new one. 0N/A // Get the data hanler. 0N/A // handler should never be null. // Get the data associated with our entry. // data may be null if the OID we were given is not valid. // make the new entry (transient object that will be kept only // for the duration of the request. // Put the entry in the cache in case we need it later while processing * 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 // Look in the contextual cache. // No handler in contextual cache, make a new one.