Class ExtendedRuntimeMXBeanImpl
- All Implemented Interfaces:
RuntimeMXBean, PlatformManagedObject, RuntimeMXBean
RuntimeMXBean.- Since:
- 1.5
-
Nested Class Summary
Nested classes/interfaces declared in interface RuntimeMXBean
RuntimeMXBean.VMIdleStatesModifier and TypeInterfaceDescriptionstatic enumDefines the different states ofRuntimeMXBean.getVMIdleState(). -
Method Summary
Modifier and TypeMethodDescriptionfinal StringReturns the boot class path that is used by the bootstrap class loader to search for class files.final StringReturns the Java class path that is used by the system class loader to search for class files.doubleReturns a double value which holds the system load average calculated for the minute preceding the call, where system load average is taken to mean the following:Returns the input arguments passed to the Java virtual machine which does not include the arguments to themainmethod.static RuntimeMXBeanSingleton accessor method.final StringReturns the Java library path.final StringReturns the version of the specification for the management interface implemented by the running Java virtual machine.final StringgetName()Returns the name representing the running Java virtual machine.final ObjectNameReturns anObjectNameinstance representing the object name of this platform managed object.final StringReturns the Java virtual machine specification name.final StringReturns the Java virtual machine specification vendor.final StringReturns the Java virtual machine specification version.final longReturns the start time of the Java virtual machine in milliseconds.Returns a map of names and values of all system properties.final longReturns the uptime of the Java virtual machine in milliseconds.doubleReturns a system load average calculated over the minute preceding the call averaged over the number of CPU available to Java virtual machine process.getVmId()This is provided for the benefit of applications which use attach API to load JVMTI agents into their own JVMs.Returns current JVM Idle state.final StringReturns the Java virtual machine implementation name.final StringReturns the Java virtual machine implementation vendor.final StringReturns the Java virtual machine implementation version.booleanQuery the state of the Attach API.booleanQuery the state of the Attach API.final booleanTests if the Java virtual machine supports the boot class path mechanism used by the bootstrap class loader to search for class files.booleanisVMIdle()Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface RuntimeMXBean
getPid
-
Method Details
-
getInstance
Singleton accessor method.- Returns:
- the
RuntimeMXBeanImplsingleton.
-
getCPULoad
public double getCPULoad()Returns a double value which holds the system load average calculated for the minute preceding the call, where system load average is taken to mean the following:The time-averaged value of the sum of the number of runnable entities running on the available processors and the number of runnable entities ready and queued to run on the available processors. The averaging technique adopted can vary depending on the underlying operating system.
- Specified by:
getCPULoadin interfaceRuntimeMXBean- Returns:
- normally, the system load average as a double. If the system load average is not obtainable (e.g. because the calculation may involve an unacceptable performance impact) then a negative value is returned.
- See Also:
-
getVMGeneratedCPULoad
public double getVMGeneratedCPULoad()Returns a system load average calculated over the minute preceding the call averaged over the number of CPU available to Java virtual machine process.- Specified by:
getVMGeneratedCPULoadin interfaceRuntimeMXBean- Returns:
- A double indicating the average system load per processor. If the system load average is not available, it returns a negative value to indicate this.
-
getVMIdleState
Returns current JVM Idle state.- Specified by:
getVMIdleStatein interfaceRuntimeMXBean- Returns:
- JVM idle state value - i.e active / idle
-
isVMIdle
public boolean isVMIdle()- Specified by:
isVMIdlein interfaceRuntimeMXBean- Returns:
- true if JVM state is idle. Otherwise returns false
-
isAttachApiInitialized
public boolean isAttachApiInitialized()Description copied from interface:RuntimeMXBeanQuery the state of the Attach API. Return false if the Attach API is: - still initializing - disabled - terminated by VM shutdown- Specified by:
isAttachApiInitializedin interfaceRuntimeMXBean- Returns:
- true if Attach API is initialized
-
isAttachApiTerminated
public boolean isAttachApiTerminated()Description copied from interface:RuntimeMXBeanQuery the state of the Attach API. Return true if the Attach API is: - disabled - terminated by VM shutdown and false if it is - still initializing - initialized and running- Specified by:
isAttachApiTerminatedin interfaceRuntimeMXBean- Returns:
- true if Attach API is terminated
-
getVmId
Description copied from interface:RuntimeMXBeanThis is provided for the benefit of applications which use attach API to load JVMTI agents into their own JVMs.- Specified by:
getVmIdin interfaceRuntimeMXBean- Returns:
- Attach API Virtual Machine ID of this VM
-
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
RuntimeMXBean.isBootClassPathSupported()method can be used to determine if the Java virtual machine supports this method.- Specified by:
getBootClassPathin interfaceRuntimeMXBean- Returns:
- the boot class path.
-
getClassPath
Returns the Java class path that is used by the system class loader to search for class files. This method is equivalent toSystem.getProperty("java.class.path").Multiple paths in the Java class path are separated by the path separator character of the platform of the Java virtual machine being monitored.
- Specified by:
getClassPathin interfaceRuntimeMXBean- Returns:
- the Java class path.
- See Also:
-
getLibraryPath
Returns the Java library path. This method is equivalent toSystem.getProperty("java.library.path").Multiple paths in the Java library path are separated by the path separator character of the platform of the Java virtual machine being monitored.
- Specified by:
getLibraryPathin interfaceRuntimeMXBean- Returns:
- the Java library path.
- See Also:
-
getManagementSpecVersion
Returns the version of the specification for the management interface implemented by the running Java virtual machine.- Specified by:
getManagementSpecVersionin interfaceRuntimeMXBean- Returns:
- the version of the specification for the management interface implemented by the running Java virtual machine.
-
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.- Specified by:
getNamein interfaceRuntimeMXBean- Returns:
- the name representing the running Java virtual machine.
-
getSpecName
Returns the Java virtual machine specification name. This method is equivalent toSystem.getProperty("java.vm.specification.name").- Specified by:
getSpecNamein interfaceRuntimeMXBean- Returns:
- the Java virtual machine specification name.
- See Also:
-
getSpecVendor
Returns the Java virtual machine specification vendor. This method is equivalent toSystem.getProperty("java.vm.specification.vendor").- Specified by:
getSpecVendorin interfaceRuntimeMXBean- Returns:
- the Java virtual machine specification vendor.
- See Also:
-
getSpecVersion
Returns the Java virtual machine specification version. This method is equivalent toSystem.getProperty("java.vm.specification.version").- Specified by:
getSpecVersionin interfaceRuntimeMXBean- Returns:
- the Java virtual machine specification version.
- See Also:
-
getStartTime
public final 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.- Specified by:
getStartTimein interfaceRuntimeMXBean- Returns:
- start time of the Java virtual machine in milliseconds.
-
getUptime
public final long getUptime()Returns the uptime of the Java virtual machine in milliseconds.- Specified by:
getUptimein interfaceRuntimeMXBean- Returns:
- uptime of the Java virtual machine in milliseconds.
-
getVmName
Returns the Java virtual machine implementation name. This method is equivalent toSystem.getProperty("java.vm.name").- Specified by:
getVmNamein interfaceRuntimeMXBean- Returns:
- the Java virtual machine implementation name.
- See Also:
-
getVmVendor
Returns the Java virtual machine implementation vendor. This method is equivalent toSystem.getProperty("java.vm.vendor").- Specified by:
getVmVendorin interfaceRuntimeMXBean- Returns:
- the Java virtual machine implementation vendor.
- See Also:
-
getVmVersion
Returns the Java virtual machine implementation version. This method is equivalent toSystem.getProperty("java.vm.version").- Specified by:
getVmVersionin interfaceRuntimeMXBean- Returns:
- the Java virtual machine implementation version.
- See Also:
-
isBootClassPathSupported
public final 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.- Specified by:
isBootClassPathSupportedin interfaceRuntimeMXBean- Returns:
trueif the Java virtual machine supports the class path mechanism;falseotherwise.
-
getInputArguments
Returns the input arguments passed to the Java virtual machine which does not include the arguments to themainmethod. 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 ofList<String>isString[].- Specified by:
getInputArgumentsin interfaceRuntimeMXBean- Returns:
- a list of
Stringobjects; each element is an argument passed to the Java virtual machine.
-
getSystemProperties
Returns a map of names and values of all system properties. This method callsSystem.getProperties()to get all system properties. Properties whose name or value is not aStringare omitted.MBeanServer access:
The mapped type ofMap<String,String>isTabularDatawith two items in each row as follows:Item Name Item Type keyStringvalueString- Specified by:
getSystemPropertiesin interfaceRuntimeMXBean- Returns:
- a map of names and values of all system properties.
-
getObjectName
Returns anObjectNameinstance representing the object name of this platform managed object.- Specified by:
getObjectNamein interfacePlatformManagedObject- Returns:
- an
ObjectNameinstance representing the object name of this platform managed object.
-