01 /*
02 * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * 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 compilation 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#getCompilationMXBean} 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 compilation system within an MBeanServer is:
42 * <blockquote>
43 * {@link ManagementFactory#COMPILATION_MXBEAN_NAME
44 * <tt>java.lang:type=Compilation</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 * @version 1.17, 05/05/07
54 * @since 1.5
55 */
56 public interface CompilationMXBean {
57 /**
58 * Returns the name of the Just-in-time (JIT) compiler.
59 *
60 * @return the name of the JIT compiler.
61 */
62 public java.lang.String getName();
63
64 /**
65 * Tests if the Java virtual machine supports the monitoring of
66 * compilation time.
67 *
68 * @return <tt>true</tt> if the monitoring of compilation time is
69 * supported ; <tt>false</tt> otherwise.
70 */
71 public boolean isCompilationTimeMonitoringSupported();
72
73 /**
74 * Returns the approximate accumlated elapsed time (in milliseconds)
75 * spent in compilation.
76 * If multiple threads are used for compilation, this value is
77 * summation of the approximate time that each thread spent in compilation.
78 *
79 * <p>This method is optionally supported by the platform.
80 * A Java virtual machine implementation may not support the compilation
81 * time monitoring. The {@link #isCompilationTimeMonitoringSupported}
82 * method can be used to determine if the Java virtual machine
83 * supports this operation.
84 *
85 * <p> This value does not indicate the level of performance of
86 * the Java virtual machine and is not intended for performance comparisons
87 * of different virtual machine implementations.
88 * The implementations may have different definitions and different
89 * measurements of the compilation time.
90 *
91 * @return Compilation time in milliseconds
92 * @throws java.lang.UnsupportedOperationException if the Java
93 * virtual machine does not support
94 * this operation.
95 *
96 */
97 public long getTotalCompilationTime();
98 }
|