1. /*
  2. * @(#)OperatingSystemMXBean.java 1.9 04/04/20
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.lang.management;
  8. /**
  9. * The management interface for the operating system on which
  10. * the Java virtual machine is running.
  11. *
  12. * <p> A Java virtual machine has a single instance of the implementation
  13. * class of this interface. This instance implementing this interface is
  14. * an <a href="ManagementFactory.html#MXBean">MXBean</a>
  15. * that can be obtained by calling
  16. * the {@link ManagementFactory#getOperatingSystemMXBean} method or
  17. * from the {@link ManagementFactory#getPlatformMBeanServer
  18. * platform <tt>MBeanServer</tt>} method.
  19. *
  20. * <p>The <tt>ObjectName</tt> for uniquely identifying the MXBean for
  21. * the operating system within an MBeanServer is:
  22. * <blockquote>
  23. * {@link ManagementFactory#OPERATING_SYSTEM_MXBEAN_NAME
  24. * <tt>java.lang:type=OperatingSystem</tt>}
  25. * </blockquote>
  26. *
  27. * <p> This interface defines several convenient methods for accessing
  28. * system properties about the operating system on which the Java
  29. * virtual machine is running.
  30. *
  31. * @see <a href="../../../javax/management/package-summary.html">
  32. * JMX Specification.</a>
  33. * @see <a href="package-summary.html#examples">
  34. * Ways to Access MXBeans</a>
  35. *
  36. * @author Mandy Chung
  37. * @version 1.9, 04/20/04
  38. * @since 1.5
  39. */
  40. public interface OperatingSystemMXBean {
  41. /**
  42. * Returns the operating system name.
  43. * This method is equivalent to <tt>System.getProperty("os.name")</tt>.
  44. *
  45. * @return the operating system name.
  46. *
  47. * @throws java.lang.SecurityException
  48. * if a security manager exists and its
  49. * <code>checkPropertiesAccess</code> method doesn't allow access
  50. * to this system property.
  51. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
  52. * @see java.lang.System#getProperty
  53. */
  54. public String getName();
  55. /**
  56. * Returns the operating system architecture.
  57. * This method is equivalent to <tt>System.getProperty("os.arch")</tt>.
  58. *
  59. * @return the operating system architecture.
  60. *
  61. * @throws java.lang.SecurityException
  62. * if a security manager exists and its
  63. * <code>checkPropertiesAccess</code> method doesn't allow access
  64. * to this system property.
  65. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
  66. * @see java.lang.System#getProperty
  67. */
  68. public String getArch();
  69. /**
  70. * Returns the operating system version.
  71. * This method is equivalent to <tt>System.getProperty("os.version")</tt>.
  72. *
  73. * @return the operating system version.
  74. *
  75. * @throws java.lang.SecurityException
  76. * if a security manager exists and its
  77. * <code>checkPropertiesAccess</code> method doesn't allow access
  78. * to this system property.
  79. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
  80. * @see java.lang.System#getProperty
  81. */
  82. public String getVersion();
  83. /**
  84. * Returns the number of processors available to the Java virtual machine.
  85. * This method is equivalent to the {@link Runtime#availableProcessors()}
  86. * method.
  87. * <p> This value may change during a particular invocation of
  88. * the virtual machine.
  89. *
  90. * @return the number of processors available to the virtual
  91. * machine; never smaller than one.
  92. */
  93. public int getAvailableProcessors();
  94. }