Path: blob/master/src/java.management/share/classes/java/lang/management/ClassLoadingMXBean.java
41159 views
/*1* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.lang.management;2627/**28* The management interface for the class loading system of29* the Java virtual machine.30*31* <p> A Java virtual machine has a single instance of the implementation32* class of this interface. This instance implementing this interface is33* an <a href="ManagementFactory.html#MXBean">MXBean</a>34* that can be obtained by calling35* the {@link ManagementFactory#getClassLoadingMXBean} method or36* from the {@link ManagementFactory#getPlatformMBeanServer37* platform MBeanServer}.38*39* <p>The {@code ObjectName} for uniquely identifying the MXBean for40* the class loading system within an {@code MBeanServer} is:41* <blockquote>42* {@link ManagementFactory#CLASS_LOADING_MXBEAN_NAME43* java.lang:type=ClassLoading}44* </blockquote>45*46* It can be obtained by calling the47* {@link PlatformManagedObject#getObjectName} method.48*49* @see ManagementFactory#getPlatformMXBeans(Class)50* @see <a href="../../../javax/management/package-summary.html">51* JMX Specification.</a>52* @see <a href="package-summary.html#examples">53* Ways to Access MXBeans</a>54*55* @author Mandy Chung56* @since 1.557*/58public interface ClassLoadingMXBean extends PlatformManagedObject {5960/**61* Returns the total number of classes that have been loaded since62* the Java virtual machine has started execution.63*64* @return the total number of classes loaded.65*66*/67public long getTotalLoadedClassCount();6869/**70* Returns the number of classes that are currently loaded in the71* Java virtual machine.72*73* @return the number of currently loaded classes.74*/75public int getLoadedClassCount();7677/**78* Returns the total number of classes unloaded since the Java virtual machine79* has started execution.80*81* @return the total number of unloaded classes.82*/83public long getUnloadedClassCount();8485/**86* Tests if the verbose output for the class loading system is enabled.87*88* @return {@code true} if the verbose output for the class loading89* system is enabled; {@code false} otherwise.90*/91public boolean isVerbose();9293/**94* Enables or disables the verbose output for the class loading95* system. The verbose output information and the output stream96* to which the verbose information is emitted are implementation97* dependent. Typically, a Java virtual machine implementation98* prints a message each time a class file is loaded.99*100* <p>This method can be called by multiple threads concurrently.101* Each invocation of this method enables or disables the verbose102* output globally.103*104* @param value {@code true} to enable the verbose output;105* {@code false} to disable.106*107* @throws java.lang.SecurityException if a security manager108* exists and the caller does not have109* ManagementPermission("control").110*/111public void setVerbose(boolean value);112113}114115116