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