0N/A/*
2362N/A * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
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 *
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 *
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.
0N/A *
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
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.lang.management;
0N/A
0N/A/**
0N/A * The management interface for the garbage collection of
0N/A * the Java virtual machine. Garbage collection is the process
0N/A * that the Java virtual machine uses to find and reclaim unreachable
0N/A * objects to free up memory space. A garbage collector is one type of
0N/A * {@link MemoryManagerMXBean memory manager}.
0N/A *
0N/A * <p> A Java virtual machine may have one or more instances of
0N/A * the implementation class of this interface.
0N/A * An instance implementing this interface is
0N/A * an <a href="ManagementFactory.html#MXBean">MXBean</a>
0N/A * that can be obtained by calling
0N/A * the {@link ManagementFactory#getGarbageCollectorMXBeans} method or
0N/A * from the {@link ManagementFactory#getPlatformMBeanServer
0N/A * platform <tt>MBeanServer</tt>} method.
0N/A *
0N/A * <p>The <tt>ObjectName</tt> for uniquely identifying the MXBean for
0N/A * a garbage collector within an MBeanServer is:
0N/A * <blockquote>
0N/A * {@link ManagementFactory#GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE
0N/A * <tt>java.lang:type=GarbageCollector</tt>}<tt>,name=</tt><i>collector's name</i>
0N/A * </blockquote>
0N/A *
178N/A * It can be obtained by calling the
178N/A * {@link PlatformManagedObject#getObjectName} method.
178N/A *
0N/A * A platform usually includes additional platform-dependent information
0N/A * specific to a garbage collection algorithm for monitoring.
0N/A *
178N/A * @see ManagementFactory#getPlatformMXBeans(Class)
0N/A * @see MemoryMXBean
0N/A *
0N/A * @see <a href="../../../javax/management/package-summary.html">
0N/A * JMX Specification.</a>
0N/A * @see <a href="package-summary.html#examples">
0N/A * Ways to Access MXBeans</a>
0N/A *
0N/A * @author Mandy Chung
0N/A * @since 1.5
0N/A */
0N/Apublic interface GarbageCollectorMXBean extends MemoryManagerMXBean {
0N/A /**
0N/A * Returns the total number of collections that have occurred.
0N/A * This method returns <tt>-1</tt> if the collection count is undefined for
0N/A * this collector.
0N/A *
0N/A * @return the total number of collections that have occurred.
0N/A */
0N/A public long getCollectionCount();
0N/A
0N/A /**
0N/A * Returns the approximate accumulated collection elapsed time
0N/A * in milliseconds. This method returns <tt>-1</tt> if the collection
0N/A * elapsed time is undefined for this collector.
0N/A * <p>
0N/A * The Java virtual machine implementation may use a high resolution
0N/A * timer to measure the elapsed time. This method may return the
0N/A * same value even if the collection count has been incremented
0N/A * if the collection elapsed time is very short.
0N/A *
0N/A * @return the approximate accumulated collection elapsed time
0N/A * in milliseconds.
0N/A */
0N/A public long getCollectionTime();
0N/A
0N/A
0N/A}