001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package java.lang.management;
019:
020: import java.util.List;
021: import java.util.Map;
022:
023: /**
024: * <p>
025: * <code>RuntimeMXBean</code> is an interface used by the management
026: * system to access JVM runtime system properties.
027: * </p>
028: * <p>
029: * <code>ObjectName</code>: java.lang:type=Runtime
030: * </p>
031: *
032: * @since 1.5
033: */
034: public interface RuntimeMXBean {
035:
036: /**
037: * <p>
038: * The boot class path used by the JVM's bootstrap class loader.
039: * </p>
040: *
041: * @return The boot class path.
042: * @throws UnsupportedOperationException if this is not supported.
043: * @throws SecurityException if caller doesn't have
044: * <code>ManagementPermission("monitor")</code>.
045: * @see #isBootClassPathSupported()
046: */
047: String getBootClassPath();
048:
049: /**
050: * <p>
051: * The class path of the JVM; equivalent to
052: * <code>System.getProperty("java.class.path")</code>.
053: * </p>
054: *
055: * @return The class path.
056: * @throws SecurityException if the
057: * {@link SecurityManager#checkPropertyAccess(String)} doesn't
058: * allow access.
059: */
060: String getClassPath();
061:
062: /**
063: * <p>
064: * The input arguments passed to the JVM upon invocation.
065: * </p>
066: *
067: * @return A List of arguments passed to the JVM.
068: *
069: * @throws SecurityException if caller doesn't have
070: * <code>ManagementPermission("monitor")</code>.
071: */
072: List<String> getInputArguments();
073:
074: /**
075: * <p>
076: * The library path of the JVM; equivalent to
077: * <code>System.getProperty("java.library.path")</code>.
078: * </p>
079: *
080: * @return The library path.
081: * @throws SecurityException if the
082: * {@link SecurityManager#checkPropertyAccess(String)} doesn't
083: * allow access.
084: */
085: String getLibraryPath();
086:
087: /**
088: * <p>
089: * The version of the management specification implemented by the JVM.
090: * </p>
091: *
092: * @return The management specification version.
093: */
094: String getManagementSpecVersion();
095:
096: /**
097: * <p>
098: * The name of the JVM.
099: * </p>
100: *
101: * @return The name of the JVM.
102: */
103: String getName();
104:
105: /**
106: * <p>
107: * The JVM specification name; equivalent to
108: * <code>System.getProperty("java.vm.specification.name")</code>.
109: * </p>
110: *
111: * @return The JVM specification name.
112: * @throws SecurityException if the
113: * {@link SecurityManager#checkPropertyAccess(String)} doesn't
114: * allow access.
115: */
116: String getSpecName();
117:
118: /**
119: * <p>
120: * The JVM specification vendor; equivalent to
121: * <code>System.getProperty("java.vm.specification.vendor")</code>.
122: * </p>
123: *
124: * @return The JVM specification vendor.
125: * @throws SecurityException if the
126: * {@link SecurityManager#checkPropertyAccess(String)} doesn't
127: * allow access.
128: */
129: String getSpecVendor();
130:
131: /**
132: * <p>
133: * The JVM specification version; equivalent to
134: * <code>System.getProperty("java.vm.specification.version")</code>.
135: * </p>
136: *
137: * @return The JVM specification version.
138: * @throws SecurityException if the
139: * {@link SecurityManager#checkPropertyAccess(String)} doesn't
140: * allow access.
141: */
142: String getSpecVersion();
143:
144: /**
145: * <p>
146: * The approximate start time (in milliseconds) of the JVM. The time is
147: * specified by {@link System#currentTimeMillis()}.
148: * </p>
149: *
150: * @return The start time of the JVM.
151: */
152: long getStartTime();
153:
154: /**
155: * <p>
156: * The current JVM system properties, as defined by
157: * {@link System#getProperties()}. Any properties whose name or value is
158: * not of type <code>String</code> are excluded.
159: * </p>
160: *
161: * @return The library path.
162: * @throws SecurityException if the
163: * {@link SecurityManager#checkPropertyAccess(String)} doesn't
164: * allow access.
165: */
166: Map<String, String> getSystemProperties();
167:
168: /**
169: * <p>
170: * The approximate time elapsed (in milliseconds) since the JVM started.
171: * </p>
172: *
173: * @return The JVM's up time.
174: */
175: long getUptime();
176:
177: /**
178: * <p>
179: * The JVM name; equivalent to
180: * <code>System.getProperty("java.vm.name")</code>.
181: * </p>
182: *
183: * @return The JVM name.
184: * @throws SecurityException if the
185: * {@link SecurityManager#checkPropertyAccess(String)} doesn't
186: * allow access.
187: */
188: String getVmName();
189:
190: /**
191: * <p>
192: * The JVM vendor; equivalent to
193: * <code>System.getProperty("java.vm.vendor")</code>.
194: * </p>
195: *
196: * @return The JVM vendor.
197: * @throws SecurityException if the
198: * {@link SecurityManager#checkPropertyAccess(String)} doesn't
199: * allow access.
200: */
201: String getVmVendor();
202:
203: /**
204: * <p>
205: * The JVM version; equivalent to
206: * <code>System.getProperty("java.vm.version")</code>.
207: * </p>
208: *
209: * @return The JVM version.
210: * @throws SecurityException if the
211: * {@link SecurityManager#checkPropertyAccess(String)} doesn't
212: * allow access.
213: */
214: String getVmVersion();
215:
216: /**
217: * <p>
218: * Indicates whether or not the boot class path is supported by this JVM.
219: * </p>
220: *
221: * @return <code>true</code> if supported, <code>false</code> otherwise.
222: */
223: boolean isBootClassPathSupported();
224: }
|