Path: blob/master/jcl/src/java.management/share/classes/java/lang/management/ClassLoadingMXBean.java
12511 views
/*[INCLUDE-IF JAVA_SPEC_VERSION >= 8]*/1/*2*******************************************************************************3* Copyright (c) 2005, 2022 IBM Corp. and others4*5* This program and the accompanying materials are made available under6* the terms of the Eclipse Public License 2.0 which accompanies this7* distribution and is available at https://www.eclipse.org/legal/epl-2.0/8* or the Apache License, Version 2.0 which accompanies this distribution and9* is available at https://www.apache.org/licenses/LICENSE-2.0.10*11* This Source Code may also be made available under the following12* Secondary Licenses when the conditions for such availability set13* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU14* General Public License, version 2 with the GNU Classpath15* Exception [1] and GNU General Public License, version 2 with the16* OpenJDK Assembly Exception [2].17*18* [1] https://www.gnu.org/software/classpath/license.html19* [2] http://openjdk.java.net/legal/assembly-exception.html20*21* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception22*******************************************************************************/23package java.lang.management;2425/**26* The management and monitoring interface for the virtual machine's class27* loading functionality.28* <p>29* Precisely one instance of this interface will be made30* available to management clients.31* </p>32* <p>33* Accessing this <code>MXBean</code> can be done in one of three ways.34* <ol>35* <li>Invoking the static ManagementFactory.getClassLoadingMXBean() method.</li>36* <li>Using a javax.management.MBeanServerConnection.</li>37* <li>Obtaining a proxy MXBean from the static38* {@code ManagementFactory.newPlatformMXBeanProxy(MBeanServerConnection connection,39* String mxbeanName, Class<T> mxbeanInterface())} method, passing in40* "java.lang:type=ClassLoading" for the value of the mxbeanName41* parameter.</li>42* </ol>43*44*/45public interface ClassLoadingMXBean extends PlatformManagedObject {4647/**48* Returns the number of classes currently loaded by the virtual machine.49* @return the number of loaded classes50*/51public int getLoadedClassCount();5253/**54* Returns a figure for the total number of classes that have been55* loaded by the virtual machine during its lifetime.56* @return the total number of classes that have been loaded57*/58public long getTotalLoadedClassCount();5960/**61* Returns a figure for the total number of classes that have62* been unloaded by the virtual machine over its lifetime.63* @return the total number of unloaded classes64*/65public long getUnloadedClassCount();6667/**68* Returns a boolean indication of whether the virtual69* machine's class loading system is producing verbose output.70* @return true if running in verbose mode71*/72public boolean isVerbose();7374/**75* Updates the virtual machine's class loading system to76* operate in verbose or non-verbose mode.77* @param value true to put the class loading system into verbose78* mode, false to take the class loading system out of verbose mode.79*/80public void setVerbose(boolean value);8182}838485