java.lang.management
Interface OperatingSystemMXBean


public interface OperatingSystemMXBean

The management interface for the operating system on which the Java virtual machine is running.

A Java virtual machine has a single instance of the implementation class of this interface. This instance implementing this interface is an MXBean that can be obtained by calling the ManagementFactory.getOperatingSystemMXBean() sample code for java.lang.management.ManagementFactory.getOperatingSystemMXBean() definition code for java.lang.management.ManagementFactory.getOperatingSystemMXBean() method or from the platform MBeanServer sample code for java.lang.management.ManagementFactory.getPlatformMBeanServer() definition code for java.lang.management.ManagementFactory.getPlatformMBeanServer() method.

The ObjectName for uniquely identifying the MXBean for the operating system within an MBeanServer is:

java.lang:type=OperatingSystem sample code for java.lang.management.ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME definition code for java.lang.management.ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME

This interface defines several convenient methods for accessing system properties about the operating system on which the Java virtual machine is running.

Since:
1.5
See Also:
JMX Specification., Ways to Access MXBeans

Method Summary
 String sample code for java.lang.String definition code for java.lang.String getArch sample code for java.lang.management.OperatingSystemMXBean.getArch() definition code for java.lang.management.OperatingSystemMXBean.getArch() ()
          Returns the operating system architecture.
 int getAvailableProcessors sample code for java.lang.management.OperatingSystemMXBean.getAvailableProcessors() definition code for java.lang.management.OperatingSystemMXBean.getAvailableProcessors() ()
          Returns the number of processors available to the Java virtual machine.
 String sample code for java.lang.String definition code for java.lang.String getName sample code for java.lang.management.OperatingSystemMXBean.getName() definition code for java.lang.management.OperatingSystemMXBean.getName() ()
          Returns the operating system name.
 String sample code for java.lang.String definition code for java.lang.String getVersion sample code for java.lang.management.OperatingSystemMXBean.getVersion() definition code for java.lang.management.OperatingSystemMXBean.getVersion() ()
          Returns the operating system version.
 

Method Detail

getName sample code for java.lang.management.OperatingSystemMXBean.getName() definition code for java.lang.management.OperatingSystemMXBean.getName()

String sample code for java.lang.String definition code for java.lang.String  getName()
Returns the operating system name. This method is equivalent to System.getProperty("os.name").

Returns:
the operating system name.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

getArch sample code for java.lang.management.OperatingSystemMXBean.getArch() definition code for java.lang.management.OperatingSystemMXBean.getArch()

String sample code for java.lang.String definition code for java.lang.String  getArch()
Returns the operating system architecture. This method is equivalent to System.getProperty("os.arch").

Returns:
the operating system architecture.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

getVersion sample code for java.lang.management.OperatingSystemMXBean.getVersion() definition code for java.lang.management.OperatingSystemMXBean.getVersion()

String sample code for java.lang.String definition code for java.lang.String  getVersion()
Returns the operating system version. This method is equivalent to System.getProperty("os.version").

Returns:
the operating system version.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

getAvailableProcessors sample code for java.lang.management.OperatingSystemMXBean.getAvailableProcessors() definition code for java.lang.management.OperatingSystemMXBean.getAvailableProcessors()

int getAvailableProcessors()
Returns the number of processors available to the Java virtual machine. This method is equivalent to the Runtime.availableProcessors() sample code for java.lang.Runtime.availableProcessors() definition code for java.lang.Runtime.availableProcessors() method.

This value may change during a particular invocation of the virtual machine.

Returns:
the number of processors available to the virtual machine; never smaller than one.