java.lang.management

Interface ClassLoadingMXBean

public interface ClassLoadingMXBean

Provides access to information about the class loading behaviour of the current invocation of the virtual machine. An instance of this bean is obtained by calling {@link ManagementFactory#getClassLoadingMXBean()}.

Since: 1.5

Method Summary
intgetLoadedClassCount()
Returns the number of classes currently loaded by the virtual machine.
longgetTotalLoadedClassCount()
Returns the total number of classes loaded by the virtual machine since it was started.
longgetUnloadedClassCount()
Returns the number of classes that have been unloaded by the virtual machine since it was started.
booleanisVerbose()
Returns true if the virtual machine will emit additional information when classes are loaded and unloaded.
voidsetVerbose(boolean verbose)
Turns on or off the emission of additional information when classes are loaded and unloaded.

Method Detail

getLoadedClassCount

public int getLoadedClassCount()
Returns the number of classes currently loaded by the virtual machine.

Returns: the number of loaded classes.

getTotalLoadedClassCount

public long getTotalLoadedClassCount()
Returns the total number of classes loaded by the virtual machine since it was started. This is the sum of the currently loaded classes and those that have been unloaded.

Returns: the total number of classes that have been loaded by the virtual machine since it started.

getUnloadedClassCount

public long getUnloadedClassCount()
Returns the number of classes that have been unloaded by the virtual machine since it was started.

Returns: the number of unloaded classes.

isVerbose

public boolean isVerbose()
Returns true if the virtual machine will emit additional information when classes are loaded and unloaded. The format of the output is left up to the virtual machine.

Returns: true if verbose class loading output is on.

setVerbose

public void setVerbose(boolean verbose)
Turns on or off the emission of additional information when classes are loaded and unloaded. The format of the output is left up to the virtual machine. This method may be called by multiple threads concurrently, but there is only one global setting of verbosity that is affected.

Parameters: verbose the new setting for verbose class loading output.

Throws: SecurityException if a security manager exists and denies ManagementPermission("control").