Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/jcl/src/java.management/share/classes/java/lang/management/CompilationMXBean.java
12511 views
1
/*[INCLUDE-IF JAVA_SPEC_VERSION >= 8]*/
2
/*
3
*******************************************************************************
4
* Copyright (c) 2005, 2022 IBM Corp. and others
5
*
6
* This program and the accompanying materials are made available under
7
* the terms of the Eclipse Public License 2.0 which accompanies this
8
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
9
* or the Apache License, Version 2.0 which accompanies this distribution and
10
* is available at https://www.apache.org/licenses/LICENSE-2.0.
11
*
12
* This Source Code may also be made available under the following
13
* Secondary Licenses when the conditions for such availability set
14
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
15
* General Public License, version 2 with the GNU Classpath
16
* Exception [1] and GNU General Public License, version 2 with the
17
* OpenJDK Assembly Exception [2].
18
*
19
* [1] https://www.gnu.org/software/classpath/license.html
20
* [2] http://openjdk.java.net/legal/assembly-exception.html
21
*
22
* 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-exception
23
*******************************************************************************/
24
package java.lang.management;
25
26
/**
27
* The management and monitoring interface for the virtual machine's compilation
28
* functionality.
29
* <p>
30
* If the virtual machine has a compilation system enabled, precisely one
31
* instance of this interface will be made available to management clients.
32
* Otherwise, there will be no instances of this <code>MXBean</code> available.
33
* </p>
34
* <p>
35
* Accessing this <code>MXBean</code> can be done in one of three ways.
36
* <ol>
37
* <li>Invoking the static ManagementFactory.getCompilationMXBean() method.
38
* </li>
39
* <li>Using a javax.management.MBeanServerConnection.</li>
40
* <li>Obtaining a proxy MXBean from the static
41
* {@link ManagementFactory#newPlatformMXBeanProxy}
42
* method, passing in the string &quot;java.lang:type=Compilation&quot; for
43
* the value of the second parameter.
44
* </li>
45
* </ol>
46
*/
47
public interface CompilationMXBean extends PlatformManagedObject {
48
49
/**
50
* Returns the name of the virtual machine's Just In Time (JIT) compiler.
51
*
52
* @return the name of the JIT compiler
53
*/
54
public String getName();
55
56
/**
57
* If supported (see {@link #isCompilationTimeMonitoringSupported()}),
58
* returns the total number of <b>milliseconds </b> spent by the virtual
59
* machine performing compilations. The figure is taken over the lifetime of
60
* the virtual machine.
61
*
62
* @return the compilation time in milliseconds
63
* @throws java.lang.UnsupportedOperationException
64
* if the virtual machine does not support compilation
65
* monitoring. This can be tested by calling the
66
* {@link #isCompilationTimeMonitoringSupported()} method.
67
*/
68
public long getTotalCompilationTime();
69
70
/**
71
* A boolean indication of whether or not the virtual machine supports the
72
* timing of its compilation facilities.
73
*
74
* @return <code>true</code> if compilation timing is supported, otherwise
75
* <code>false</code>.
76
*/
77
public boolean isCompilationTimeMonitoringSupported();
78
79
}
80
81