java.lang.management
Interface RuntimeMXBean


public interface RuntimeMXBean

The management interface for the runtime system of the Java virtual machine.

A Java virtual machine has a single instance of the implementation class of this interface. This instance implementing this interface is an MXBean that can be obtained by calling the ManagementFactory.getRuntimeMXBean() sample code for java.lang.management.ManagementFactory.getRuntimeMXBean() definition code for java.lang.management.ManagementFactory.getRuntimeMXBean() method or from the platform MBeanServer sample code for java.lang.management.ManagementFactory.getPlatformMBeanServer() definition code for java.lang.management.ManagementFactory.getPlatformMBeanServer() method.

The ObjectName for uniquely identifying the MXBean for the runtime system within an MBeanServer is:

java.lang:type=Runtime sample code for java.lang.management.ManagementFactory.RUNTIME_MXBEAN_NAME definition code for java.lang.management.ManagementFactory.RUNTIME_MXBEAN_NAME

This interface defines several convenient methods for accessing system properties about the Java virtual machine.

Since:
1.5
See Also:
JMX Specification., Ways to Access MXBeans

Method Summary
 String sample code for java.lang.String definition code for java.lang.String getBootClassPath sample code for java.lang.management.RuntimeMXBean.getBootClassPath() definition code for java.lang.management.RuntimeMXBean.getBootClassPath() ()
          Returns the boot class path that is used by the bootstrap class loader to search for class files.
 String sample code for java.lang.String definition code for java.lang.String getClassPath sample code for java.lang.management.RuntimeMXBean.getClassPath() definition code for java.lang.management.RuntimeMXBean.getClassPath() ()
          Returns the Java class path that is used by the system class loader to search for class files.
 List sample code for java.util.List definition code for java.util.List <String sample code for java.lang.String definition code for java.lang.String > getInputArguments sample code for java.lang.management.RuntimeMXBean.getInputArguments() definition code for java.lang.management.RuntimeMXBean.getInputArguments() ()
          Returns the input arguments passed to the Java virtual machine which does not include the arguments to the main method.
 String sample code for java.lang.String definition code for java.lang.String getLibraryPath sample code for java.lang.management.RuntimeMXBean.getLibraryPath() definition code for java.lang.management.RuntimeMXBean.getLibraryPath() ()
          Returns the Java library path.
 String sample code for java.lang.String definition code for java.lang.String getManagementSpecVersion sample code for java.lang.management.RuntimeMXBean.getManagementSpecVersion() definition code for java.lang.management.RuntimeMXBean.getManagementSpecVersion() ()
          Returns the version of the specification for the management interface implemented by the running Java virtual machine.
 String sample code for java.lang.String definition code for java.lang.String getName sample code for java.lang.management.RuntimeMXBean.getName() definition code for java.lang.management.RuntimeMXBean.getName() ()
          Returns the name representing the running Java virtual machine.
 String sample code for java.lang.String definition code for java.lang.String getSpecName sample code for java.lang.management.RuntimeMXBean.getSpecName() definition code for java.lang.management.RuntimeMXBean.getSpecName() ()
          Returns the Java virtual machine specification name.
 String sample code for java.lang.String definition code for java.lang.String getSpecVendor sample code for java.lang.management.RuntimeMXBean.getSpecVendor() definition code for java.lang.management.RuntimeMXBean.getSpecVendor() ()
          Returns the Java virtual machine specification vendor.
 String sample code for java.lang.String definition code for java.lang.String getSpecVersion sample code for java.lang.management.RuntimeMXBean.getSpecVersion() definition code for java.lang.management.RuntimeMXBean.getSpecVersion() ()
          Returns the Java virtual machine specification version.
 long getStartTime sample code for java.lang.management.RuntimeMXBean.getStartTime() definition code for java.lang.management.RuntimeMXBean.getStartTime() ()
          Returns the start time of the Java virtual machine in milliseconds.
 Map sample code for java.util.Map definition code for java.util.Map <String sample code for java.lang.String definition code for java.lang.String ,String sample code for java.lang.String definition code for java.lang.String > getSystemProperties sample code for java.lang.management.RuntimeMXBean.getSystemProperties() definition code for java.lang.management.RuntimeMXBean.getSystemProperties() ()
          Returns a map of names and values of all system properties.
 long getUptime sample code for java.lang.management.RuntimeMXBean.getUptime() definition code for java.lang.management.RuntimeMXBean.getUptime() ()
          Returns the uptime of the Java virtual machine in milliseconds.
 String sample code for java.lang.String definition code for java.lang.String getVmName sample code for java.lang.management.RuntimeMXBean.getVmName() definition code for java.lang.management.RuntimeMXBean.getVmName() ()
          Returns the Java virtual machine implementation name.
 String sample code for java.lang.String definition code for java.lang.String getVmVendor sample code for java.lang.management.RuntimeMXBean.getVmVendor() definition code for java.lang.management.RuntimeMXBean.getVmVendor() ()
          Returns the Java virtual machine implementation vendor.
 String sample code for java.lang.String definition code for java.lang.String getVmVersion sample code for java.lang.management.RuntimeMXBean.getVmVersion() definition code for java.lang.management.RuntimeMXBean.getVmVersion() ()
          Returns the Java virtual machine implementation version.
 boolean isBootClassPathSupported sample code for java.lang.management.RuntimeMXBean.isBootClassPathSupported() definition code for java.lang.management.RuntimeMXBean.isBootClassPathSupported() ()
          Tests if the Java virtual machine supports the boot class path mechanism used by the bootstrap class loader to search for class files.
 

Method Detail

getName sample code for java.lang.management.RuntimeMXBean.getName() definition code for java.lang.management.RuntimeMXBean.getName()

String sample code for java.lang.String definition code for java.lang.String  getName()
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.

Returns:
the name representing the running Java virtual machine.

getVmName sample code for java.lang.management.RuntimeMXBean.getVmName() definition code for java.lang.management.RuntimeMXBean.getVmName()

String sample code for java.lang.String definition code for java.lang.String  getVmName()
Returns the Java virtual machine implementation name. This method is equivalent to System.getProperty("java.vm.name") sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String) .

Returns:
the Java virtual machine implementation name.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

getVmVendor sample code for java.lang.management.RuntimeMXBean.getVmVendor() definition code for java.lang.management.RuntimeMXBean.getVmVendor()

String sample code for java.lang.String definition code for java.lang.String  getVmVendor()
Returns the Java virtual machine implementation vendor. This method is equivalent to System.getProperty("java.vm.vendor") sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String) .

Returns:
the Java virtual machine implementation vendor.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

getVmVersion sample code for java.lang.management.RuntimeMXBean.getVmVersion() definition code for java.lang.management.RuntimeMXBean.getVmVersion()

String sample code for java.lang.String definition code for java.lang.String  getVmVersion()
Returns the Java virtual machine implementation version. This method is equivalent to System.getProperty("java.vm.version") sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String) .

Returns:
the Java virtual machine implementation version.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

getSpecName sample code for java.lang.management.RuntimeMXBean.getSpecName() definition code for java.lang.management.RuntimeMXBean.getSpecName()

String sample code for java.lang.String definition code for java.lang.String  getSpecName()
Returns the Java virtual machine specification name. This method is equivalent to System.getProperty("java.vm.specification.name") sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String) .

Returns:
the Java virtual machine specification name.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

getSpecVendor sample code for java.lang.management.RuntimeMXBean.getSpecVendor() definition code for java.lang.management.RuntimeMXBean.getSpecVendor()

String sample code for java.lang.String definition code for java.lang.String  getSpecVendor()
Returns the Java virtual machine specification vendor. This method is equivalent to System.getProperty("java.vm.specification.vendor") sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String) .

Returns:
the Java virtual machine specification vendor.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

getSpecVersion sample code for java.lang.management.RuntimeMXBean.getSpecVersion() definition code for java.lang.management.RuntimeMXBean.getSpecVersion()

String sample code for java.lang.String definition code for java.lang.String  getSpecVersion()
Returns the Java virtual machine specification version. This method is equivalent to System.getProperty("java.vm.specification.version") sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String) .

Returns:
the Java virtual machine specification version.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

getManagementSpecVersion sample code for java.lang.management.RuntimeMXBean.getManagementSpecVersion() definition code for java.lang.management.RuntimeMXBean.getManagementSpecVersion()

String sample code for java.lang.String definition code for java.lang.String  getManagementSpecVersion()
Returns the version of the specification for the management interface implemented by the running Java virtual machine.

Returns:
the version of the specification for the management interface implemented by the running Java virtual machine.

getClassPath sample code for java.lang.management.RuntimeMXBean.getClassPath() definition code for java.lang.management.RuntimeMXBean.getClassPath()

String sample code for java.lang.String definition code for java.lang.String  getClassPath()
Returns the Java class path that is used by the system class loader to search for class files. This method is equivalent to System.getProperty("java.class.path") sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String) .

Multiple paths in the Java class path are separated by the path separator character of the platform of the Java virtual machine being monitored.

Returns:
the Java class path.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

getLibraryPath sample code for java.lang.management.RuntimeMXBean.getLibraryPath() definition code for java.lang.management.RuntimeMXBean.getLibraryPath()

String sample code for java.lang.String definition code for java.lang.String  getLibraryPath()
Returns the Java library path. This method is equivalent to System.getProperty("java.library.path") sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String) .

Multiple paths in the Java library path are separated by the path separator character of the platform of the Java virtual machine being monitored.

Returns:
the Java library path.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to this system property.
See Also:
SecurityManager.checkPropertyAccess(java.lang.String) sample code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) definition code for java.lang.SecurityManager.checkPropertyAccess(java.lang.String) , System.getProperty(java.lang.String) sample code for java.lang.System.getProperty(java.lang.String) definition code for java.lang.System.getProperty(java.lang.String)

isBootClassPathSupported sample code for java.lang.management.RuntimeMXBean.isBootClassPathSupported() definition code for java.lang.management.RuntimeMXBean.isBootClassPathSupported()

boolean isBootClassPathSupported()
Tests if the Java virtual machine supports the boot class path mechanism used by the bootstrap class loader to search for class files.

Returns:
true if the Java virtual machine supports the class path mechanism; false otherwise.

getBootClassPath sample code for java.lang.management.RuntimeMXBean.getBootClassPath() definition code for java.lang.management.RuntimeMXBean.getBootClassPath()

String sample code for java.lang.String definition code for java.lang.String  getBootClassPath()
Returns the boot class path that is used by the bootstrap class loader to search for class files.

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.

A Java virtual machine implementation may not support the boot class path mechanism for the bootstrap class loader to search for class files. The isBootClassPathSupported() sample code for java.lang.management.RuntimeMXBean.isBootClassPathSupported() definition code for java.lang.management.RuntimeMXBean.isBootClassPathSupported() method can be used to determine if the Java virtual machine supports this method.

Returns:
the boot class path.
Throws:
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if the Java virtual machine does not support this operation.
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and the caller does not have ManagementPermission("monitor").

getInputArguments sample code for java.lang.management.RuntimeMXBean.getInputArguments() definition code for java.lang.management.RuntimeMXBean.getInputArguments()

List sample code for java.util.List definition code for java.util.List <String sample code for java.lang.String definition code for java.lang.String > getInputArguments()
Returns the input arguments passed to the Java virtual machine which does not include the arguments to the main method. This method returns an empty list if there is no input argument to the Java virtual machine.

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.

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.

MBeanServer access:
The mapped type of List is String[].

Returns:
a list of String objects; each element is an argument passed to the Java virtual machine.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and the caller does not have ManagementPermission("monitor").

getUptime sample code for java.lang.management.RuntimeMXBean.getUptime() definition code for java.lang.management.RuntimeMXBean.getUptime()

long getUptime()
Returns the uptime of the Java virtual machine in milliseconds.

Returns:
uptime of the Java virtual machine in milliseconds.

getStartTime sample code for java.lang.management.RuntimeMXBean.getStartTime() definition code for java.lang.management.RuntimeMXBean.getStartTime()

long getStartTime()
Returns the start time of the Java virtual machine in milliseconds. This method returns the approximate time when the Java virtual machine started.

Returns:
start time of the Java virtual machine in milliseconds.

getSystemProperties sample code for java.lang.management.RuntimeMXBean.getSystemProperties() definition code for java.lang.management.RuntimeMXBean.getSystemProperties()

Map sample code for java.util.Map definition code for java.util.Map <String sample code for java.lang.String definition code for java.lang.String ,String sample code for java.lang.String definition code for java.lang.String > getSystemProperties()
Returns a map of names and values of all system properties. This method calls System.getProperties() sample code for java.lang.System.getProperties() definition code for java.lang.System.getProperties() to get all system properties. Properties whose name or value is not a String are omitted.

MBeanServer access:
The mapped type of Map is TabularData sample code for javax.management.openmbean.TabularData definition code for javax.management.openmbean.TabularData with two items in each row as follows:

Item Name Item Type
key String
value String

Returns:
a map of names and values of all system properties.
Throws:
SecurityException sample code for java.lang.SecurityException definition code for java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to the system properties.