1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
/* * @(#)RuntimeMXBean.java 1.14 05/11/17 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package java.lang.management; /** * The management interface for the runtime system of * the Java virtual machine. * * <p> A Java virtual machine has a single instance of the implementation * class of this interface. This instance implementing this interface is * an <a href="ManagementFactory.html#MXBean">MXBean</a> * that can be obtained by calling * the {@link ManagementFactory#getRuntimeMXBean} method or * from the {@link ManagementFactory#getPlatformMBeanServer * platform <tt>MBeanServer</tt>} method. * * <p>The <tt>ObjectName</tt> for uniquely identifying the MXBean for * the runtime system within an MBeanServer is: * <blockquote> * {@link ManagementFactory#RUNTIME_MXBEAN_NAME * <tt>java.lang:type=Runtime</tt>} * </blockquote> * * <p> This interface defines several convenient methods for accessing * system properties about the Java virtual machine. * * @see <a href="../../../javax/management/package-summary.html"> * JMX Specification.</a> * @see <a href="package-summary.html#examples"> * Ways to Access MXBeans</a> * * @author Mandy Chung * @version 1.14, 11/17/05 * @since 1.5 */ public interface RuntimeMXBean { /** * Returns the name representing the running Java virtual machine. * The returned name string can be any arbitrary string and * a Java virtual machine implementation can choose * to embed platform-specific useful information in the * returned name string. Each running virtual machine could have * a different name. * * @return the name representing the running Java virtual machine. */ public String getName(); /** * Returns the Java virtual machine implementation name. * This method is equivalent to {@link System#getProperty * System.getProperty("java.vm.name")}. * * @return the Java virtual machine implementation name. * * @throws java.lang.SecurityException * if a security manager exists and its * <code>checkPropertiesAccess</code> method doesn't allow access * to this system property. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String) * @see java.lang.System#getProperty */ public String getVmName(); /** * Returns the Java virtual machine implementation vendor. * This method is equivalent to {@link System#getProperty * System.getProperty("java.vm.vendor")}. * * @return the Java virtual machine implementation vendor. * * @throws java.lang.SecurityException * if a security manager exists and its * <code>checkPropertiesAccess</code> method doesn't allow access * to this system property. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String) * @see java.lang.System#getProperty */ public String getVmVendor(); /** * Returns the Java virtual machine implementation version. * This method is equivalent to {@link System#getProperty * System.getProperty("java.vm.version")}. * * @return the Java virtual machine implementation version. * * @throws java.lang.SecurityException * if a security manager exists and its * <code>checkPropertiesAccess</code> method doesn't allow access * to this system property. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String) * @see java.lang.System#getProperty */ public String getVmVersion(); /** * Returns the Java virtual machine specification name. * This method is equivalent to {@link System#getProperty * System.getProperty("java.vm.specification.name")}. * * @return the Java virtual machine specification name. * * @throws java.lang.SecurityException * if a security manager exists and its * <code>checkPropertiesAccess</code> method doesn't allow access * to this system property. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String) * @see java.lang.System#getProperty */ public String getSpecName(); /** * Returns the Java virtual machine specification vendor. * This method is equivalent to {@link System#getProperty * System.getProperty("java.vm.specification.vendor")}. * * @return the Java virtual machine specification vendor. * * @throws java.lang.SecurityException * if a security manager exists and its * <code>checkPropertiesAccess</code> method doesn't allow access * to this system property. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String) * @see java.lang.System#getProperty */ public String getSpecVendor(); /** * Returns the Java virtual machine specification version. * This method is equivalent to {@link System#getProperty * System.getProperty("java.vm.specification.version")}. * * @return the Java virtual machine specification version. * * @throws java.lang.SecurityException * if a security manager exists and its * <code>checkPropertiesAccess</code> method doesn't allow access * to this system property. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String) * @see java.lang.System#getProperty */ public String getSpecVersion(); /** * Returns the version of the specification for the management interface * implemented by the running Java virtual machine. * * @return the version of the specification for the management interface * implemented by the running Java virtual machine. */ public String getManagementSpecVersion(); /** * Returns the Java class path that is used by the system class loader * to search for class files. * This method is equivalent to {@link System#getProperty * System.getProperty("java.class.path")}. * * <p> Multiple paths in the Java class path are separated by the * path separator character of the platform of the Java virtual machine * being monitored. * * @return the Java class path. * * @throws java.lang.SecurityException * if a security manager exists and its * <code>checkPropertiesAccess</code> method doesn't allow access * to this system property. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String) * @see java.lang.System#getProperty */ public String getClassPath(); /** * Returns the Java library path. * This method is equivalent to {@link System#getProperty * System.getProperty("java.library.path")}. * * <p> Multiple paths in the Java library path are separated by the * path separator character of the platform of the Java virtual machine * being monitored. * * @return the Java library path. * * @throws java.lang.SecurityException * if a security manager exists and its * <code>checkPropertiesAccess</code> method doesn't allow access * to this system property. * @see java.lang.SecurityManager#checkPropertyAccess(java.lang.String) * @see java.lang.System#getProperty */ public String getLibraryPath(); /** * Tests if the Java virtual machine supports the boot class path * mechanism used by the bootstrap class loader to search for class * files. * * @return <tt>true</tt> if the Java virtual machine supports the * class path mechanism; <tt>false</tt> otherwise. */ public boolean isBootClassPathSupported(); /** * Returns the boot class path that is used by the bootstrap class loader * to search for class files. * * <p> Multiple paths in the boot class path are separated by the * path separator character of the platform on which the Java * virtual machine is running. * * <p>A Java virtual machine implementation may not support * the boot class path mechanism for the bootstrap class loader * to search for class files. * The {@link #isBootClassPathSupported} method can be used * to determine if the Java virtual machine supports this method. * * @return the boot class path. * * @throws java.lang.UnsupportedOperationException * if the Java virtual machine does not support this operation. * * @throws java.lang.SecurityException * if a security manager exists and the caller does not have * ManagementPermission("monitor"). */ public String getBootClassPath(); /** * Returns the input arguments passed to the Java virtual machine * which does not include the arguments to the <tt>main</tt> method. * This method returns an empty list if there is no input argument * to the Java virtual machine. * <p> * Some Java virtual machine implementations may take input arguments * from multiple different sources: for examples, arguments passed from * the application that launches the Java virtual machine such as * the 'java' command, environment variables, configuration files, etc. * <p> * Typically, not all command-line options to the 'java' command * are passed to the Java virtual machine. * Thus, the returned input arguments may not * include all command-line options. * * <p> * <b>MBeanServer access</b>:<br> * The mapped type of <tt>List<String></tt> is <tt>String[]</tt>. * * @return a list of <tt>String</tt> objects; each element * is an argument passed to the Java virtual machine. * * @throws java.lang.SecurityException * if a security manager exists and the caller does not have * ManagementPermission("monitor"). */ public java.util.List<String> getInputArguments(); /** * Returns the uptime of the Java virtual machine in milliseconds. * * @return uptime of the Java virtual machine in milliseconds. */ public long getUptime(); /** * Returns the start time of the Java virtual machine in milliseconds. * This method returns the approximate time when the Java virtual * machine started. * * @return start time of the Java virtual machine in milliseconds. * */ public long getStartTime(); /** * Returns a map of names and values of all system properties. * This method calls {@link System#getProperties} to get all * system properties. Properties whose name or value is not * a <tt>String</tt> are omitted. * * <p> * <b>MBeanServer access</b>:<br> * The mapped type of <tt>Map<String,String></tt> is * {@link javax.management.openmbean.TabularData TabularData} * with two items in each row as follows: * <blockquote> * <table border> * <tr> * <th>Item Name</th> * <th>Item Type</th> * </tr> * <tr> * <td><tt>key</tt></td> * <td><tt>String</tt></td> * </tr> * <tr> * <td><tt>value</tt></td> * <td><tt>String</tt></td> * </tr> * </table> * </blockquote> * * @return a map of names and values of all system properties. * * @throws java.lang.SecurityException * if a security manager exists and its * <code>checkPropertiesAccess</code> method doesn't allow access * to the system properties. */ public java.util.Map<String, String> getSystemProperties(); }