jdk/src/share/classes/java/lang/management/CompilationMXBean.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 401 ef01e0dccd63
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2003-2004 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.lang.management;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * The management interface for the compilation system of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * the Java virtual machine.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * <p> A Java virtual machine has a single instance of the implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * class of this interface.  This instance implementing this interface is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * an <a href="ManagementFactory.html#MXBean">MXBean</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * that can be obtained by calling
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * the {@link ManagementFactory#getCompilationMXBean} method or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * from the {@link ManagementFactory#getPlatformMBeanServer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * platform <tt>MBeanServer</tt>} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * <p>The <tt>ObjectName</tt> for uniquely identifying the MXBean for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * the compilation system within an MBeanServer is:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * <blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *  {@link ManagementFactory#COMPILATION_MXBEAN_NAME
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *         <tt>java.lang:type=Compilation</tt>}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * </blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * @see <a href="../../../javax/management/package-summary.html">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 *      JMX Specification.</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * @see <a href="package-summary.html#examples">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 *      Ways to Access MXBeans</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * @author  Mandy Chung
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
public interface CompilationMXBean {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * Returns the name of the Just-in-time (JIT) compiler.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * @return the name of the JIT compiler.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    public java.lang.String    getName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * Tests if the Java virtual machine supports the monitoring of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * compilation time.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * @return <tt>true</tt> if the monitoring of compilation time is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * supported ; <tt>false</tt> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public boolean isCompilationTimeMonitoringSupported();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * Returns the approximate accumlated elapsed time (in milliseconds)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * spent in compilation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * If multiple threads are used for compilation, this value is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * summation of the approximate time that each thread spent in compilation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * <p>This method is optionally supported by the platform.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * A Java virtual machine implementation may not support the compilation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * time monitoring. The {@link #isCompilationTimeMonitoringSupported}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * method can be used to determine if the Java virtual machine
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * supports this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * <p> This value does not indicate the level of performance of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * the Java virtual machine and is not intended for performance comparisons
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * of different virtual machine implementations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * The implementations may have different definitions and different
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * measurements of the compilation time.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * @return Compilation time in milliseconds
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * @throws java.lang.UnsupportedOperationException if the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * virtual machine does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    public long                getTotalCompilationTime();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
}