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/OperatingSystemMXBean.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 operating system where the
28
* virtual machine is running.
29
* <p>
30
* Precisely one instance of this interface will be made available to management
31
* clients.
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.getOperatingSystemMXBean() method.
37
* </li>
38
* <li>Using a javax.management.MBeanServerConnection.</li>
39
* <li>Obtaining a proxy MXBean from the static
40
* {@link ManagementFactory#newPlatformMXBeanProxy} method, passing in
41
* &quot;java.lang:type=OperatingSystem&quot; for the value of the second
42
* parameter.</li>
43
* </ol>
44
*
45
* @since 1.5
46
*/
47
public interface OperatingSystemMXBean extends PlatformManagedObject {
48
49
/**
50
* Returns a unique string identifier for the architecture of the underlying
51
* operating system. The identifier value is identical to that which would
52
* be obtained from a call to {@link System#getProperty(java.lang.String)}
53
* supplying the value &quot;os.arch&quot; for the key.
54
*
55
* @return the identifier for the operating system architecture.
56
* @throws SecurityException
57
* if there is a security manager in operation and the caller
58
* does not have permission to check system properties.
59
* @see System#getProperty(java.lang.String)
60
*/
61
public String getArch();
62
63
/**
64
* Returns the number of processors that are available for the virtual
65
* machine to run on. The information returned from this method is identical
66
* to that which would be received from a call to
67
* {@link Runtime#availableProcessors()}.
68
*
69
* @return the number of available processors.
70
*/
71
public int getAvailableProcessors();
72
73
/**
74
* Returns the name of the underlying operating system. The value is
75
* identical to that which would be obtained from a call to
76
* {@link System#getProperty(java.lang.String)} supplying the value
77
* &quot;os.name&quot; for the key.
78
*
79
* @return the name of the operating system.
80
* @throws SecurityException
81
* if there is a security manager in operation and the caller
82
* does not have permission to check system properties.
83
* @see System#getProperty(java.lang.String)
84
*/
85
public String getName();
86
87
/**
88
* Returns the version string for the underlying operating system. The value
89
* is identical to that which would be obtained from a call to
90
* {@link System#getProperty(java.lang.String)} supplying the value
91
* &quot;os.version&quot; for the key.
92
*
93
* @return the version of the operating system.
94
* @throws SecurityException
95
* if there is a security manager in operation and the caller
96
* does not have permission to check system properties.
97
* @see System#getProperty(java.lang.String)
98
*/
99
public String getVersion();
100
101
/**
102
* Returns a double value which holds the system load average calculated for
103
* the minute preceding the call, where <i>system load average</i> is taken
104
* to mean the following:
105
* <p>
106
* the time-averaged value of the sum of the number of runnable entities
107
* running on the available processors and the number of runnable entities
108
* ready and queued to run on the available processors. The averaging
109
* technique adopted can vary depending on the underlying operating system.
110
*
111
* @return normally, the system load average as a double. If the system load
112
* average is not obtainable (e.g. because the calculation may
113
* involve an unacceptable performance impact) then a negative value
114
* is returned.
115
* @since 1.6
116
*/
117
public double getSystemLoadAverage();
118
119
}
120
121