3261N/A * Copyright (c) 2007, 2008, 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 management interface for a buffer pool, for example a pool of 0N/A * {@link java.nio.ByteBuffer#allocateDirect direct} or {@link 0N/A * java.nio.MappedByteBuffer mapped} buffers. 0N/A * <p> A class implementing this interface is an 0N/A * {@link javax.management.MXBean}. A Java 0N/A * virtual machine has one or more implementations of this interface. The {@link 0N/A * java.lang.management.ManagementFactory#getPlatformMXBeans getPlatformMXBeans} 0N/A * method can be used to obtain the list of {@code BufferPoolMXBean} objects 0N/A * representing the management interfaces for pools of buffers as follows: 0N/A * List<BufferPoolMXBean> pools = ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class); 0N/A * <p> The management interfaces are also registered with the platform {@link 0N/A * javax.management.MBeanServer MBeanServer}. The {@link 0N/A * javax.management.ObjectName ObjectName} that uniquely identifies the 0N/A * management interface within the {@code MBeanServer} takes the form: 0N/A * java.nio:type=BufferPool,name=<i>pool name</i> 0N/A * where <em>pool name</em> is the {@link #getName name} of the buffer pool. 1127N/A * Returns the name representing this buffer pool. 687N/A * @return The name of this buffer pool. 0N/A * Returns an estimate of the number of buffers in the pool. 0N/A * @return An estimate of the number of buffers in this pool 0N/A * Returns an estimate of the total capacity of the buffers in this pool. 0N/A * A buffer's capacity is the number of elements it contains and the value 0N/A * returned by this method is an estimate of the total capacity of buffers 0N/A * in the pool in bytes. 0N/A * @return An estimate of the total capacity of the buffers in this pool 0N/A * Returns an estimate of the memory that the Java virtual machine is using 0N/A * for this buffer pool. The value returned by this method may differ 0N/A * from the estimate of the total {@link #getTotalCapacity capacity} of 0N/A * the buffers in this pool. This difference is explained by alignment, 0N/A * memory allocator, and other implementation specific reasons. 0N/A * @return An estimate of the memory that the Java virtual machine is using 0N/A * for this buffer pool in bytes, or {@code -1L} if an estimate of 0N/A * the memory usage is not available