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 {@link ManagementFactory#getOperatingSystemMXBean()}.

Since: 1.5

Method Summary
StringgetArch()
Returns the name of the underlying system architecture.
intgetAvailableProcessors()
Returns the number of processors currently available to the virtual machine.
StringgetName()
Returns the name of the underlying operating system.
doublegetSystemLoadAverage()
Returns the system load average for the last minute, or -1 if this is unavailable.
StringgetVersion()
Returns the version of the underlying operating system.

Method Detail

getArch

public String getArch()
Returns the name of the underlying system architecture. This is equivalent to obtaining the os.arch property via {@link 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: getProperty checkPropertyAccess

getAvailableProcessors

public 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 {@link Runtime#availableProcessors()}.

Returns: the number of processors available to the VM.

getName

public String getName()
Returns the name of the underlying operating system. This is equivalent to obtaining the os.name property via {@link 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: getProperty checkPropertyAccess

getSystemLoadAverage

public 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

public String getVersion()
Returns the version of the underlying operating system. This is equivalent to obtaining the os.version property via {@link 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: getProperty checkPropertyAccess