2
|
1 |
/*
|
|
2 |
* Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
|
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
|
7 |
* published by the Free Software Foundation. Sun designates this
|
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
|
9 |
* by Sun in the LICENSE file that accompanied this code.
|
|
10 |
*
|
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
* accompanied this code).
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License version
|
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
*
|
|
21 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
22 |
* CA 95054 USA or visit www.sun.com if you need additional information or
|
|
23 |
* have any questions.
|
|
24 |
*/
|
|
25 |
|
|
26 |
package java.lang.management;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* The management interface for the class loading system of
|
|
30 |
* the Java virtual machine.
|
|
31 |
*
|
|
32 |
* <p> A Java virtual machine has a single instance of the implementation
|
|
33 |
* class of this interface. This instance implementing this interface is
|
|
34 |
* an <a href="ManagementFactory.html#MXBean">MXBean</a>
|
|
35 |
* that can be obtained by calling
|
|
36 |
* the {@link ManagementFactory#getClassLoadingMXBean} method or
|
|
37 |
* from the {@link ManagementFactory#getPlatformMBeanServer
|
|
38 |
* platform <tt>MBeanServer</tt>} method.
|
|
39 |
*
|
|
40 |
* <p>The <tt>ObjectName</tt> for uniquely identifying the MXBean for
|
|
41 |
* the class loading system within an <tt>MBeanServer</tt> is:
|
|
42 |
* <blockquote>
|
|
43 |
* {@link ManagementFactory#CLASS_LOADING_MXBEAN_NAME
|
|
44 |
* <tt>java.lang:type=ClassLoading</tt>}
|
|
45 |
* </blockquote>
|
|
46 |
*
|
|
47 |
* @see <a href="../../../javax/management/package-summary.html">
|
|
48 |
* JMX Specification.</a>
|
|
49 |
* @see <a href="package-summary.html#examples">
|
|
50 |
* Ways to Access MXBeans</a>
|
|
51 |
*
|
|
52 |
* @author Mandy Chung
|
|
53 |
* @since 1.5
|
|
54 |
*/
|
|
55 |
public interface ClassLoadingMXBean {
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Returns the total number of classes that have been loaded since
|
|
59 |
* the Java virtual machine has started execution.
|
|
60 |
*
|
|
61 |
* @return the total number of classes loaded.
|
|
62 |
*
|
|
63 |
*/
|
|
64 |
public long getTotalLoadedClassCount();
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Returns the number of classes that are currently loaded in the
|
|
68 |
* Java virtual machine.
|
|
69 |
*
|
|
70 |
* @return the number of currently loaded classes.
|
|
71 |
*/
|
|
72 |
public int getLoadedClassCount();
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Returns the total number of classes unloaded since the Java virtual machine
|
|
76 |
* has started execution.
|
|
77 |
*
|
|
78 |
* @return the total number of unloaded classes.
|
|
79 |
*/
|
|
80 |
public long getUnloadedClassCount();
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Tests if the verbose output for the class loading system is enabled.
|
|
84 |
*
|
|
85 |
* @return <tt>true</tt> if the verbose output for the class loading
|
|
86 |
* system is enabled; <tt>false</tt> otherwise.
|
|
87 |
*/
|
|
88 |
public boolean isVerbose();
|
|
89 |
|
|
90 |
/**
|
|
91 |
* Enables or disables the verbose output for the class loading
|
|
92 |
* system. The verbose output information and the output stream
|
|
93 |
* to which the verbose information is emitted are implementation
|
|
94 |
* dependent. Typically, a Java virtual machine implementation
|
|
95 |
* prints a message each time a class file is loaded.
|
|
96 |
*
|
|
97 |
* <p>This method can be called by multiple threads concurrently.
|
|
98 |
* Each invocation of this method enables or disables the verbose
|
|
99 |
* output globally.
|
|
100 |
*
|
|
101 |
* @param value <tt>true</tt> to enable the verbose output;
|
|
102 |
* <tt>false</tt> to disable.
|
|
103 |
*
|
|
104 |
* @exception java.lang.SecurityException if a security manager
|
|
105 |
* exists and the caller does not have
|
|
106 |
* ManagementPermission("control").
|
|
107 |
*/
|
|
108 |
public void setVerbose(boolean value);
|
|
109 |
|
|
110 |
}
|