- All Superinterfaces:
PlatformManagedObject
- All Known Subinterfaces:
RuntimeMXBean
The management and monitoring interface for the runtime system of the virtual
machine.
Precisely one instance of this interface will be made available to management clients.
Accessing this MXBean
can be done in one of three ways.
- Invoking the static ManagementFactory.getRuntimeMXBean() method.
- Using a javax.management.MBeanServerConnection.
- Obtaining a proxy MXBean from the static
ManagementFactory.newPlatformMXBeanProxy(javax.management.MBeanServerConnection, java.lang.String, java.lang.Class<T>)
method, passing in "java.lang:type=Runtime" for the value of the second parameter.
- Since:
- 1.5
-
Method Summary
Modifier and TypeMethodDescriptionIf bootstrap class loading is supported by the virtual machine, returns a string containing the full bootstrap class path used by the boot class loader to locate and load class files.Returns the class path string used by the system class loader to locate and load class files.Returns a list of all of the input arguments passed to the virtual machine on start-up.Returns the Java library path that will be used by the virtual machine to locate and load libraries.Returns a string containing the management interface specification version that the virtual machine meets.getName()
Returns the string name of this virtual machine.default long
getPid()
Returns the process ID (PID) of the current running Java virtual machine.Returns the name of the Java virtual machine specification followed by this virtual machine.Returns the name of the Java virtual machine specification vendor.Returns the name of the Java virtual machine specification version.long
Returns the time, in milliseconds, when the virtual machine was started.Returns a map of the names and values of every system property known to the virtual machine.long
Returns the lifetime of the virtual machine in milliseconds.Returns the name of the Java virtual machine implementation.Returns the name of the Java virtual machine implementation vendor.Returns the version of the Java virtual machine implementation.boolean
Returns a boolean indication of whether or not the virtual machine supports a bootstrap class loading mechanism.Methods declared in interface java.lang.management.PlatformManagedObject
getObjectName
-
Method Details
-
getBootClassPath
String getBootClassPath()If bootstrap class loading is supported by the virtual machine, returns a string containing the full bootstrap class path used by the boot class loader to locate and load class files.An indication of whether or not the virtual machine supports a boot class loader mechanism can be found from invoking the
isBootClassPathSupported()
method.- Returns:
- the bootstrap classpath with each entry separated by the path separator character corresponding to the underlying operating system.
- Throws:
UnsupportedOperationException
- if the virtual machine does not support boot class loading.SecurityException
- if there is a security manager in effect and the caller does not haveManagementPermission
of "monitor".
-
getClassPath
String getClassPath()Returns the class path string used by the system class loader to locate and load class files. The value is identical to that which would be obtained from a call toSystem.getProperty(java.lang.String)
supplying the value "java.class.path" for the key.- Returns:
- the system classpath with each entry separated by the path separator character corresponding to the underlying operating system.
- Throws:
SecurityException
- if there is a security manager in operation and the caller does not have permission to check system properties.- See Also:
-
getInputArguments
Returns a list of all of the input arguments passed to the virtual machine on start-up. This will not include any input arguments that are passed into the application'smain(String[] args)
method.- Returns:
- a list of strings, each one containing an argument to the virtual machine. If no virtual machine arguments were passed in at start-up time then this will be an empty list.
-
getLibraryPath
String getLibraryPath()Returns the Java library path that will be used by the virtual machine to locate and load libraries. The value is identical to that which would be obtained from a call toSystem.getProperty(java.lang.String)
supplying the value "java.library.path" for the key.- Returns:
- the Java library path with each entry separated by the path separator character corresponding to the underlying operating system.
- Throws:
SecurityException
- if there is a security manager in operation and the caller does not have permission to check system properties.- See Also:
-
getManagementSpecVersion
String getManagementSpecVersion()Returns a string containing the management interface specification version that the virtual machine meets.- Returns:
- the version of the management interface specification adhered to by the virtual machine.
-
getName
String getName()Returns the string name of this virtual machine. This value may be different for each particular running virtual machine.- Returns:
- the name of this running virtual machine.
-
getPid
default long getPid()Returns the process ID (PID) of the current running Java virtual machine.- Returns:
- the process ID of the current running JVM
- Since:
- 10
-
getSpecName
String getSpecName()Returns the name of the Java virtual machine specification followed by this virtual machine. The value is identical to that which would be obtained from a call toSystem.getProperty(java.lang.String)
supplying the value "java.vm.specification.name" for the key.- Returns:
- the name of the Java virtual machine specification.
- Throws:
SecurityException
- if there is a security manager in operation and the caller does not have permission to check system properties.- See Also:
-
getSpecVendor
String getSpecVendor()Returns the name of the Java virtual machine specification vendor. The value is identical to that which would be obtained from a call toSystem.getProperty(java.lang.String)
supplying the value "java.vm.specification.vendor" for the key.- Returns:
- the name of the Java virtual machine specification vendor.
- Throws:
SecurityException
- if there is a security manager in operation and the caller does not have permission to check system properties.- See Also:
-
getSpecVersion
String getSpecVersion()Returns the name of the Java virtual machine specification version. The value is identical to that which would be obtained from a call toSystem.getProperty(java.lang.String)
supplying the value "java.vm.specification.version" for the key.- Returns:
- the Java virtual machine specification version.
- Throws:
SecurityException
- if there is a security manager in operation and the caller does not have permission to check system properties.- See Also:
-
getStartTime
long getStartTime()Returns the time, in milliseconds, when the virtual machine was started.- Returns:
- the virtual machine start time in milliseconds.
-
getSystemProperties
Returns a map of the names and values of every system property known to the virtual machine.- Returns:
- a map containing the names and values of every system property.
- Throws:
SecurityException
- if there is a security manager in operation and the caller does not have permission to check system properties.
-
getUptime
long getUptime()Returns the lifetime of the virtual machine in milliseconds.- Returns:
- the number of milliseconds the virtual machine has been running.
-
getVmName
String getVmName()Returns the name of the Java virtual machine implementation. The value is identical to that which would be obtained from a call toSystem.getProperty(java.lang.String)
supplying the value "java.vm.name" for the key.- Returns:
- the name of the Java virtual machine implementation.
- Throws:
SecurityException
- if there is a security manager in operation and the caller does not have permission to check system properties.- See Also:
-
getVmVendor
String getVmVendor()Returns the name of the Java virtual machine implementation vendor. The value is identical to that which would be obtained from a call toSystem.getProperty(java.lang.String)
supplying the value "java.vm.vendor" for the key.- Returns:
- the name of the Java virtual machine implementation vendor.
- Throws:
SecurityException
- if there is a security manager in operation and the caller does not have permission to check system properties.- See Also:
-
getVmVersion
String getVmVersion()Returns the version of the Java virtual machine implementation. The value is identical to that which would be obtained from a call toSystem.getProperty(java.lang.String)
supplying the value "java.vm.version" for the key.- Returns:
- the version of the Java virtual machine implementation.
- Throws:
SecurityException
- if there is a security manager in operation and the caller does not have permission to check system properties.- See Also:
-
isBootClassPathSupported
boolean isBootClassPathSupported()Returns a boolean indication of whether or not the virtual machine supports a bootstrap class loading mechanism.- Returns:
true
if supported,false
otherwise.
-