Interface OperatingSystemMXBean

All Superinterfaces:
PlatformManagedObject
All Known Subinterfaces:
OperatingSystemMXBean, OperatingSystemMXBean, UnixOperatingSystemMXBean, UnixOperatingSystemMXBean

public interface OperatingSystemMXBean extends PlatformManagedObject
The management and monitoring interface for the operating system where the virtual machine is running.

Precisely one instance of this interface will be made available to management clients.

Accessing this MXBean can be done in one of three ways.

  1. Invoking the static ManagementFactory.getOperatingSystemMXBean() method.
  2. Using a javax.management.MBeanServerConnection.
  3. Obtaining a proxy MXBean from the static ManagementFactory.newPlatformMXBeanProxy(javax.management.MBeanServerConnection, java.lang.String, java.lang.Class<T>) method, passing in "java.lang:type=OperatingSystem" for the value of the second parameter.
Since:
1.5
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a unique string identifier for the architecture of the underlying operating system.
    int
    Returns the number of processors that are available for the virtual machine to run on.
    Returns the name of the underlying operating system.
    double
    Returns a double value which holds the system load average calculated for the minute preceding the call, where system load average is taken to mean the following:
    Returns the version string for the underlying operating system.

    Methods declared in interface java.lang.management.PlatformManagedObject

    getObjectName
  • Method Details

    • getArch

      String getArch()
      Returns a unique string identifier for the architecture of the underlying operating system. The identifier value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "os.arch" for the key.
      Returns:
      the identifier for the operating system architecture.
      Throws:
      SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
      See Also:
    • getAvailableProcessors

      int getAvailableProcessors()
      Returns the number of processors that are available for the virtual machine to run on. The information returned from this method is identical to that which would be received from a call to Runtime.availableProcessors().
      Returns:
      the number of available processors.
    • getName

      String getName()
      Returns the name of the underlying operating system. The value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "os.name" for the key.
      Returns:
      the name of the operating system.
      Throws:
      SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
      See Also:
    • getVersion

      String getVersion()
      Returns the version string for the underlying operating system. The value is identical to that which would be obtained from a call to System.getProperty(java.lang.String) supplying the value "os.version" for the key.
      Returns:
      the version of the operating system.
      Throws:
      SecurityException - if there is a security manager in operation and the caller does not have permission to check system properties.
      See Also:
    • getSystemLoadAverage

      double getSystemLoadAverage()
      Returns a double value which holds the system load average calculated for the minute preceding the call, where system load average is taken to mean the following:

      the time-averaged value of the sum of the number of runnable entities running on the available processors and the number of runnable entities ready and queued to run on the available processors. The averaging technique adopted can vary depending on the underlying operating system.

      Returns:
      normally, the system load average as a double. If the system load average is not obtainable (e.g. because the calculation may involve an unacceptable performance impact) then a negative value is returned.
      Since:
      1.6