Path: blob/master/jcl/src/java.management/share/classes/java/lang/management/CompilationMXBean.java
12511 views
/*[INCLUDE-IF JAVA_SPEC_VERSION >= 8]*/1/*2*******************************************************************************3* Copyright (c) 2005, 2022 IBM Corp. and others4*5* This program and the accompanying materials are made available under6* the terms of the Eclipse Public License 2.0 which accompanies this7* distribution and is available at https://www.eclipse.org/legal/epl-2.0/8* or the Apache License, Version 2.0 which accompanies this distribution and9* is available at https://www.apache.org/licenses/LICENSE-2.0.10*11* This Source Code may also be made available under the following12* Secondary Licenses when the conditions for such availability set13* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU14* General Public License, version 2 with the GNU Classpath15* Exception [1] and GNU General Public License, version 2 with the16* OpenJDK Assembly Exception [2].17*18* [1] https://www.gnu.org/software/classpath/license.html19* [2] http://openjdk.java.net/legal/assembly-exception.html20*21* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception22*******************************************************************************/23package java.lang.management;2425/**26* The management and monitoring interface for the virtual machine's compilation27* functionality.28* <p>29* If the virtual machine has a compilation system enabled, precisely one30* instance of this interface will be made available to management clients.31* Otherwise, there will be no instances of this <code>MXBean</code> available.32* </p>33* <p>34* Accessing this <code>MXBean</code> can be done in one of three ways.35* <ol>36* <li>Invoking the static ManagementFactory.getCompilationMXBean() method.37* </li>38* <li>Using a javax.management.MBeanServerConnection.</li>39* <li>Obtaining a proxy MXBean from the static40* {@link ManagementFactory#newPlatformMXBeanProxy}41* method, passing in the string "java.lang:type=Compilation" for42* the value of the second parameter.43* </li>44* </ol>45*/46public interface CompilationMXBean extends PlatformManagedObject {4748/**49* Returns the name of the virtual machine's Just In Time (JIT) compiler.50*51* @return the name of the JIT compiler52*/53public String getName();5455/**56* If supported (see {@link #isCompilationTimeMonitoringSupported()}),57* returns the total number of <b>milliseconds </b> spent by the virtual58* machine performing compilations. The figure is taken over the lifetime of59* the virtual machine.60*61* @return the compilation time in milliseconds62* @throws java.lang.UnsupportedOperationException63* if the virtual machine does not support compilation64* monitoring. This can be tested by calling the65* {@link #isCompilationTimeMonitoringSupported()} method.66*/67public long getTotalCompilationTime();6869/**70* A boolean indication of whether or not the virtual machine supports the71* timing of its compilation facilities.72*73* @return <code>true</code> if compilation timing is supported, otherwise74* <code>false</code>.75*/76public boolean isCompilationTimeMonitoringSupported();7778}798081