A Java virtual machine has a single instance of the implementation
class of this interface. This instance implementing this interface is
an MXBean
that can be obtained by calling
the ManagementFactory#getClassLoadingMXBean method or
from the platform MBeanServer.
The ObjectName for uniquely identifying the MXBean for
the class loading system within an MBeanServer is:
java.lang:type=ClassLoading
It can be obtained by calling the
PlatformManagedObject#getObjectName method.
ManagementFactory#getPlatformMXBeans(Class), JMX Specification., Ways to Access MXBeans
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the number of currently loaded classes.Returns the number of classes that are currently loaded in the Java virtual machine. |
| public long | Returns: the total number of classes loaded.Returns the total number of classes that have been loaded since the Java virtual machine has started execution. |
| public long | Returns: the total number of unloaded classes.Returns the total number of classes unloaded since the Java virtual machine has started execution. |
| public boolean | Returns: true if the verbose output for the class loading
system is enabled; false otherwise.Tests if the verbose output for the class loading system is enabled. |
| public void | setVerbose(boolean
true to enable the verbose output;
false to disable.Enables or disables the verbose output for the class loading system. |
| getLoadedClassCount | back to summary |
|---|---|
| public int getLoadedClassCount() Returns the number of classes that are currently loaded in the Java virtual machine.
| |
| getTotalLoadedClassCount | back to summary |
|---|---|
| public long getTotalLoadedClassCount() Returns the total number of classes that have been loaded since the Java virtual machine has started execution.
| |
| getUnloadedClassCount | back to summary |
|---|---|
| public long getUnloadedClassCount() Returns the total number of classes unloaded since the Java virtual machine has started execution.
| |
| isVerbose | back to summary |
|---|---|
| public boolean isVerbose() Tests if the verbose output for the class loading system is enabled.
| |
| setVerbose | back to summary |
|---|---|
| public void setVerbose(boolean value) Enables or disables the verbose output for the class loading system. The verbose output information and the output stream to which the verbose information is emitted are implementation dependent. Typically, a Java virtual machine implementation prints a message each time a class file is loaded. This method can be called by multiple threads concurrently. Each invocation of this method enables or disables the verbose output globally.
| |