java.lang.management
Interface OperatingSystemMXBean


public interface OperatingSystemMXBean

Provides access to information about the underlying operating system. An instance of this bean is obtained by calling ManagementFactory.getOperatingSystemMXBean().

Since:
1.5

Method Summary
 String getArch()
          Returns the name of the underlying system architecture.
 int getAvailableProcessors()
          Returns the number of processors currently available to the virtual machine.
 String getName()
          Returns the name of the underlying operating system.
 double getSystemLoadAverage()
          Returns the system load average for the last minute, or -1 if this is unavailable.
 String getVersion()
          Returns the version of the underlying operating system.
 

Method Detail

getArch

String getArch()
Returns the name of the underlying system architecture. This is equivalent to obtaining the os.arch property via System.getProperty(String).

Returns:
the name of the underlying system architecture on which the VM is running.
Throws:
SecurityException - if a security manager exists which prevents access to the name property.
See Also:
System.getProperty(String), SecurityManager.checkPropertyAccess(String)

getAvailableProcessors

int getAvailableProcessors()
Returns the number of processors currently available to the virtual machine. This number is subject to change during execution of the virtual machine, and will always be >= 1. The call is equivalent to Runtime.availableProcessors().

Returns:
the number of processors available to the VM.

getName

String getName()
Returns the name of the underlying operating system. This is equivalent to obtaining the os.name property via System.getProperty(String).

Returns:
the name of the operating system on which the VM is running.
Throws:
SecurityException - if a security manager exists which prevents access to the name property.
See Also:
System.getProperty(String), SecurityManager.checkPropertyAccess(String)

getSystemLoadAverage

double getSystemLoadAverage()
Returns the system load average for the last minute, or -1 if this is unavailable. The availability and calculation of the load average is system-dependent, but is usually a damped time-dependent average obtained by monitoring the number of queued and running processes. It is expected that this method will be called frequently to monitor the average over time, so it may not be implemented on systems where such a call is expensive.

Returns:
the system load average for the last minute, or -1 if this is unavailable.
Since:
1.6

getVersion

String getVersion()
Returns the version of the underlying operating system. This is equivalent to obtaining the os.version property via System.getProperty(String).

Returns:
the version of the operating system on which the VM is running.
Throws:
SecurityException - if a security manager exists which prevents access to the name property.
See Also:
System.getProperty(String), SecurityManager.checkPropertyAccess(String)