Class ExtendedThreadMXBeanImpl
- All Implemented Interfaces:
 ThreadMXBean, ThreadMXBean, PlatformManagedObject, ThreadMXBean
- 
Method Summary
Modifier and TypeMethodDescriptiondumpAllExtendedThreads(boolean lockedMonitors, boolean lockedSynchronizers) API method that fetches an array of ExtendedThreadInfo objects corresponding to threads in the virtual machine during the time it is invoked.dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers) Returns an array ofThreadInfoobjects holding information on all threads that were alive when the call was invoked.dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth) Returns an array ofThreadInfoobjects holding information on all threads that were alive when the call was invoked.long[]If supported by the virtual machine, this method can be used to retrieve thelongid of all threads currently waiting on object monitors or ownable synchronizers (synchronizers that make use of theAbstractOwnableSynchronizertype and which are completely owned by a single thread).long[]Returns the thread identifiers of every thread in this virtual machine that is currently blocked in a deadlock situation over a monitor object.long[]Returns an array of the identifiers of all of the threads that are alive in the current virtual machine.longIf supported by the virtual machine, returns the total CPU usage time for the currently running thread.longIf supported by the virtual machine, returns the total CPU usage time for the current thread running in user mode.intReturns the number of daemon threads currently alive in the virtual machine.static ThreadMXBeanSingleton accessor method.longgetNativeThreadId(long threadId) To satisfy com.ibm.lang.management.long[]getNativeThreadIds(long[] threadIDs) To satisfy com.ibm.lang.management.ThreadMXBean.Returns anObjectNameinstance representing the object name of this platform managed object.intReturns the peak number of threads that have ever been alive in the virtual machine at any one instant since either the virtual machine start-up or the peak was reset.longgetThreadAllocatedBytes(long threadId) Returns an approximation of the total amount of memory, in bytes, allocated in heap memory for the thread with the specified ID.long[]getThreadAllocatedBytes(long[] threadIds) Returns an approximation of the total amount of memory, in bytes, allocated in heap memory for each thread whose ID is in the input arrayids.intReturns the number of threads currently alive in the virtual machine.longgetThreadCpuTime(long id) If supported by the virtual machine, returns the total CPU usage time for the thread with the specified identifier.long[]getThreadCpuTime(long[] threadIds) Returns the total CPU time for each thread whose ID is in the input arrayidsin nanoseconds.getThreadInfo(long id) Returns aThreadInfoobject for the thread with the specified identifier.getThreadInfo(long[] ids) Returns an array ofThreadInfoobjects ; one for each of the threads specified in the input array of identifiers.getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers) Get together information for threads and create instances of the ThreadInfo class.getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth) Returns an array ofThreadInfoobjects; one for each of the threads specified in theidsargument.getThreadInfo(long[] ids, int maxDepth) Returns an array ofThreadInfoobjects ; one for each of the threads specified in theidsargument.getThreadInfo(long id, int maxDepth) Returns aThreadInfoobject for the thread with the specified identifier.longgetThreadUserTime(long id) If supported by the virtual machine, returns the total CPU usage time for the thread with the specified identifier when running in user mode.long[]getThreadUserTime(long[] threadIds) Returns the CPU time that each thread whose ID is in the input arrayidshas executed in user mode in nanoseconds.longReturns the number of threads that have been started in this virtual machine since it came into being.booleanReturns a boolean indication of whether or not the virtual machine supports the CPU timing of the current thread.booleanReturns a boolean indication of whether or not the virtual machine supports the monitoring of object monitor usage.booleanReturns a boolean indication of whether or not the virtual machine supports the monitoring of ownable synchronizers (synchronizers that make use of theAbstractOwnableSynchronizertype and which are completely owned by a single thread).booleanTests if thread memory allocation measurement is enabled.booleanTests if the Java virtual machine implementation supports thread memory allocation measurement.booleanReturns a boolean indication of whether or not the monitoring of thread contention situations is enabled on this virtual machine.booleanReturns a boolean indication of whether or not the monitoring of thread contention situations is supported on this virtual machine.booleanReturns a boolean indication of whether or not the CPU timing of threads is enabled on this virtual machine.booleanReturns a boolean indication of whether or not the virtual machine supports the CPU time measurement of any threads (current or otherwise).voidResets the peak thread count to be the current number of threads alive in the virtual machine when the call is made.voidsetThreadAllocatedMemoryEnabled(boolean value) Enables or disables thread memory allocation measurement.voidsetThreadContentionMonitoringEnabled(boolean enable) Updates the virtual machine to either enable or disable the monitoring of thread contention situations.voidsetThreadCpuTimeEnabled(boolean enable) If supported, updates the virtual machine to either enable or disable the CPU timing of threads.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface PlatformManagedObject
getObjectNameMethods declared in interface ThreadMXBean
getNativeThreadId, getNativeThreadIdsMethods declared in interface ThreadMXBean
getCurrentThreadAllocatedBytes, getTotalThreadAllocatedBytesMethods declared in interface ThreadMXBean
dumpAllThreads, dumpAllThreads, findDeadlockedThreads, findMonitorDeadlockedThreads, getAllThreadIds, getCurrentThreadCpuTime, getCurrentThreadUserTime, getDaemonThreadCount, getPeakThreadCount, getThreadCount, getThreadCpuTime, getThreadInfo, getThreadInfo, getThreadInfo, getThreadInfo, getThreadInfo, getThreadInfo, getThreadUserTime, getTotalStartedThreadCount, isCurrentThreadCpuTimeSupported, isObjectMonitorUsageSupported, isSynchronizerUsageSupported, isThreadContentionMonitoringEnabled, isThreadContentionMonitoringSupported, isThreadCpuTimeEnabled, isThreadCpuTimeSupported, resetPeakThreadCount, setThreadContentionMonitoringEnabled, setThreadCpuTimeEnabled 
- 
Method Details
- 
getInstance
Singleton accessor method.- Returns:
 - the 
ExtendedThreadMXBeanImplsingleton. 
 - 
dumpAllExtendedThreads
public ExtendedThreadInfo[] dumpAllExtendedThreads(boolean lockedMonitors, boolean lockedSynchronizers) throws InternalError, SecurityException, UnsupportedOperationException API method that fetches an array of ExtendedThreadInfo objects corresponding to threads in the virtual machine during the time it is invoked. Fetches an array of ExtendedThreadInfo objects that provide native thread identifiers along with java.lang.management.ThreadInfo object representing the thread. Consider using dumpAllExtendedThreads() in place of dumpAllThreads() as it provides additional thread identification information in an efficient manner.- Specified by:
 dumpAllExtendedThreadsin interfaceThreadMXBean- Parameters:
 lockedMonitors- boolean indication of whether or not information on all currently locked object monitors is to be included in the returned arraylockedSynchronizers- boolean indication of whether or not information on all currently locked ownable synchronizers is to be included in the returned array- Returns:
 - Array of ExtendedThreadInfo objects.
 - Throws:
 InternalError- is thrown in case an error occurs while fetching thread information, typically, an internal error resulting from an inconsistency in the class library.UnsupportedOperationException- is thrown if the JVM does not support monitoring object monitor usage or ownable synchronizer usage, even as it has been specified.SecurityException
 - 
getThreadAllocatedBytes
public long getThreadAllocatedBytes(long threadId) Returns an approximation of the total amount of memory, in bytes, allocated in heap memory for the thread with the specified ID. The returned value is an approximation because some Java virtual machine implementations may use object allocation mechanisms that result in a delay between the time an object is allocated and the time its size is recorded.If the thread with the specified ID is a virtual thread, is not alive, or does not exist, this method returns
-1. If thread memory allocation measurement is disabled, this method returns-1. A thread is alive if it has been started and has not yet terminated.If thread memory allocation measurement is enabled after the thread has started, the Java virtual machine implementation may choose any time up to and including the time that the capability is enabled as the point where thread memory allocation measurement starts.
- Specified by:
 getThreadAllocatedBytesin interfaceThreadMXBean- Parameters:
 threadId- the thread ID of a thread- Returns:
 - an approximation of the total memory allocated, in bytes, in
heap memory for the thread with the specified ID if the thread with the
specified ID is a platform thread, the thread is alive, and thread memory
allocation measurement is enabled; 
-1otherwise. - See Also:
 
 - 
getThreadAllocatedBytes
public long[] getThreadAllocatedBytes(long[] threadIds) Returns an approximation of the total amount of memory, in bytes, allocated in heap memory for each thread whose ID is in the input arrayids. The returned values are approximations because some Java virtual machine implementations may use object allocation mechanisms that result in a delay between the time an object is allocated and the time its size is recorded.This method is equivalent to calling the
ThreadMXBean.getThreadAllocatedBytes(long)method for each thread ID in the input arrayidsand setting the returned value in the corresponding element of the returned array.- Specified by:
 getThreadAllocatedBytesin interfaceThreadMXBean- Parameters:
 threadIds- an array of thread IDs.- Returns:
 - an array of long values, each of which is an approximation of the total memory allocated, in bytes, in heap memory for the thread whose ID is in the corresponding element of the input array of IDs.
 - See Also:
 
 - 
getThreadCpuTime
public long[] getThreadCpuTime(long[] threadIds) Returns the total CPU time for each thread whose ID is in the input arrayidsin nanoseconds. The returned values are of nanoseconds precision but not necessarily nanoseconds accuracy.This method is equivalent to calling the
ThreadMXBean.getThreadCpuTime(long)method for each thread ID in the input arrayidsand setting the returned value in the corresponding element of the returned array.- Specified by:
 getThreadCpuTimein interfaceThreadMXBean- Parameters:
 threadIds- an array of thread IDs.- Returns:
 - an array of long values, each of which is the amount of CPU
time the thread whose ID is in the corresponding element of the input
array of IDs has used, if the thread of a specified ID is a platform
thread, the thread is alive, and CPU time measurement is enabled;
-1otherwise. - See Also:
 
 - 
getThreadUserTime
public long[] getThreadUserTime(long[] threadIds) Returns the CPU time that each thread whose ID is in the input arrayidshas executed in user mode in nanoseconds. The returned values are of nanoseconds precision but not necessarily nanoseconds accuracy.This method is equivalent to calling the
ThreadMXBean.getThreadUserTime(long)method for each thread ID in the input arrayidsand setting the returned value in the corresponding element of the returned array.- Specified by:
 getThreadUserTimein interfaceThreadMXBean- Parameters:
 threadIds- an array of thread IDs.- Returns:
 - an array of long values, each of which is the amount of user
mode CPU time the thread whose ID is in the corresponding element of
the input array of IDs has used, if the thread of a specified ID is a
platform thread, the thread is alive, and CPU time measurement is enabled;
-1otherwise. - See Also:
 
 - 
isThreadAllocatedMemorySupported
public boolean isThreadAllocatedMemorySupported()Tests if the Java virtual machine implementation supports thread memory allocation measurement.- Specified by:
 isThreadAllocatedMemorySupportedin interfaceThreadMXBean- Returns:
 trueif the Java virtual machine implementation supports thread memory allocation measurement;falseotherwise.
 - 
isThreadAllocatedMemoryEnabled
public boolean isThreadAllocatedMemoryEnabled()Tests if thread memory allocation measurement is enabled.- Specified by:
 isThreadAllocatedMemoryEnabledin interfaceThreadMXBean- Returns:
 trueif thread memory allocation measurement is enabled;falseotherwise.- See Also:
 
 - 
setThreadAllocatedMemoryEnabled
public void setThreadAllocatedMemoryEnabled(boolean value) Enables or disables thread memory allocation measurement. The default is platform dependent.- Specified by:
 setThreadAllocatedMemoryEnabledin interfaceThreadMXBean- Parameters:
 value-trueto enable;falseto disable.- See Also:
 
 - 
findMonitorDeadlockedThreads
public long[] findMonitorDeadlockedThreads()Returns the thread identifiers of every thread in this virtual machine that is currently blocked in a deadlock situation over a monitor object. A thread is considered to be deadlocked if it is blocked waiting to run and owns an object monitor that is sought by another blocked thread. Two or more threads can be in a deadlock cycle. To determine the threads currently deadlocked by object monitors and ownable synchronizers use theThreadMXBean.findDeadlockedThreads()method.It is recommended that this method be used solely for problem determination analysis and not as a means of managing thread synchronization in a virtual machine. This is because the method may be very expensive to run.
- Specified by:
 findMonitorDeadlockedThreadsin interfaceThreadMXBean- Returns:
 - an array of the identifiers of every thread in the virtual
        machine that has been detected as currently being in a deadlock
        situation over an object monitor. May be 
nullif there are currently no threads in that category. 
 - 
getAllThreadIds
public long[] getAllThreadIds()Returns an array of the identifiers of all of the threads that are alive in the current virtual machine. When processing the return from this method it should not be assumed that each identified thread is still alive.- Specified by:
 getAllThreadIdsin interfaceThreadMXBean- Returns:
 - the identifiers of all of the threads currently alive in the virtual machine.
 
 - 
getCurrentThreadCpuTime
public long getCurrentThreadCpuTime()If supported by the virtual machine, returns the total CPU usage time for the currently running thread. The returned time will have nanosecond precision but may not have nanosecond accuracy.Method
ThreadMXBean.isCurrentThreadCpuTimeSupported()may be used to determine if current thread CPU timing is supported on the virtual machine. On virtual machines where current thread CPU timing is supported, the methodThreadMXBean.isThreadCpuTimeEnabled()may be used to determine if thread CPU timing is actually enabled.The return value is identical to that which would be obtained by calling
ThreadMXBean.getThreadCpuTime(long)with an argumentThread.currentThread().getId()).- Specified by:
 getCurrentThreadCpuTimein interfaceThreadMXBean- Returns:
 - on virtual machines where current thread CPU timing is supported
        and thread CPU timing is enabled, the number of nanoseconds CPU
        usage by the current thread. On virtual machines where current
        thread CPU timing is supported but thread CPU timing is not
        enabled, 
-1. 
 - 
getCurrentThreadUserTime
public long getCurrentThreadUserTime()If supported by the virtual machine, returns the total CPU usage time for the current thread running in user mode. The returned time will have nanosecond precision but may not have nanosecond accuracy.Method
ThreadMXBean.isCurrentThreadCpuTimeSupported()may be used to determine if current thread CPU timing is supported on the virtual machine. On virtual machines where current thread CPU timing is supported, the methodThreadMXBean.isThreadCpuTimeEnabled()may be used to determine if thread CPU timing is actually enabled.The return value is identical to that which would be obtained by calling
ThreadMXBean.getThreadUserTime(long)with an argumentThread.currentThread().getId()).- Specified by:
 getCurrentThreadUserTimein interfaceThreadMXBean- Returns:
 - on virtual machines where current thread CPU timing is supported
        and thread CPU timing is enabled, the number of nanoseconds CPU
        time used by the current thread running in user mode. On virtual
        machines where current thread CPU timing is supported but thread
        CPU timing is not enabled, 
-1. 
 - 
getDaemonThreadCount
public int getDaemonThreadCount()Returns the number of daemon threads currently alive in the virtual machine.- Specified by:
 getDaemonThreadCountin interfaceThreadMXBean- Returns:
 - the number of currently alive daemon threads.
 
 - 
getPeakThreadCount
public int getPeakThreadCount()Returns the peak number of threads that have ever been alive in the virtual machine at any one instant since either the virtual machine start-up or the peak was reset.- Specified by:
 getPeakThreadCountin interfaceThreadMXBean- Returns:
 - the peak number of live threads
 - See Also:
 
 - 
getThreadCount
public int getThreadCount()Returns the number of threads currently alive in the virtual machine. This includes both daemon threads and non-daemon threads.- Specified by:
 getThreadCountin interfaceThreadMXBean- Returns:
 - the number of currently alive threads.
 
 - 
getThreadCpuTime
public long getThreadCpuTime(long id) If supported by the virtual machine, returns the total CPU usage time for the thread with the specified identifier. The returned time will have nanosecond precision but may not have nanosecond accuracy.Method
ThreadMXBean.isThreadCpuTimeSupported()may be used to determine if the CPU timing of threads is supported on the virtual machine. On virtual machines where current thread CPU timing is supported, the methodThreadMXBean.isThreadCpuTimeEnabled()may be used to determine if thread CPU timing is actually enabled.- Specified by:
 getThreadCpuTimein interfaceThreadMXBean- Parameters:
 id- the identifier for a thread. Must be a positive number greater than zero.- Returns:
 - on virtual machines where thread CPU timing is supported and
        enabled, and there is a living thread with identifier
        
id, the number of nanoseconds CPU time used by the thread. On virtual machines where thread CPU timing is supported but not enabled, or where there is no living thread with identifieridpresent in the virtual machine, a value of-1is returned. - See Also:
 
 - 
getThreadInfo
Returns aThreadInfoobject for the thread with the specified identifier. The returned object will not have a stack trace so that a call to itsgetStackTrace()method will result in an emptyStackTraceElementarray. Similarly, the returned object will hold no details of locked synchronizers or locked object monitors for the specified thread; calls togetLockedMonitors()andgetLockedSynchronizerswill both return array values.- Specified by:
 getThreadInfoin interfaceThreadMXBean- Parameters:
 id- the identifier for a thread. Must be a positive number greater than zero.- Returns:
 - if the supplied 
idmaps to a living thread in the virtual machine (i.e. a started thread which has not yet died), this method returns aThreadInfoobject corresponding to that thread. Otherwise, returnsnull. 
 - 
getThreadInfo
Returns an array ofThreadInfoobjects ; one for each of the threads specified in the input array of identifiers. None of the objects in the return array will have a stack trace so that a call to itsgetStackTrace()method will result in an emptyStackTraceElementarray. Similarly, the returned object will hold no details of locked synchronizers or locked object monitors for the specified thread; calls togetLockedMonitors()andgetLockedSynchronizerswill both return array values.- Specified by:
 getThreadInfoin interfaceThreadMXBean- Parameters:
 ids- an array of thread identifiers. Each one must be a positive number greater than zero.- Returns:
 - an array of 
ThreadInfoobjects with each entry corresponding to one of the threads specified in the input array of identifiers. The return array will therefore have an identical number of elements to the inputidsarray. If an entry in theidsarray is invalid (there is no living thread with the supplied identifier in the virtual machine) then the corresponding entry in the return array will be anull. 
 - 
getThreadInfo
Returns an array ofThreadInfoobjects ; one for each of the threads specified in theidsargument. The stack trace information in the returned objects will depend on the value of themaxDepthargument which specifies the maximum number ofStackTraceElementinstances to try and include. A subsequent call to any of the returned objects'getStackTrace()method should result in aStackTraceElementarray of up tomaxDepthelements. AmaxDepthvalue ofInteger.MAX_VALUEwill attempt to obtain all of the stack trace information for each specified thread while amaxDepthvalue of zero will yield none.The returned object will hold no details of locked synchronizers or locked object monitors for the specified thread; calls to
getLockedMonitors()andgetLockedSynchronizerswill both return array values.- Specified by:
 getThreadInfoin interfaceThreadMXBean- Parameters:
 ids- an array of thread identifiers. Each must be a positive number greater than zero.maxDepth- the maximum number of stack trace entries to be included in each of the returnedThreadInfoobjects. SupplyingInteger.MAX_VALUEattempts to obtain all of the stack traces. Only a positive value is expected.- Returns:
 - an array of 
ThreadInfoobjects. The size of the array will be identical to that of theidsargument. Null elements will be placed in the array if the corresponding thread identifier inidsdoes not resolve to a living thread in the virtual machine (i.e. a started thread which has not yet died). 
 - 
getThreadInfo
Get together information for threads and create instances of the ThreadInfo class.Assumes that caller has already carried out error checking on the
idandmaxDeptharguments.- Specified by:
 getThreadInfoin interfaceThreadMXBean- Parameters:
 ids- thread idslockedMonitors- iftrueattempt to set the returnedThreadInfowith details of object monitors locked by the specified threadlockedSynchronizers- iftrueattempt to set the returnedThreadInfowith details of ownable synchronizers locked by the specified thread- Returns:
 - information for threads
 
 - 
getThreadInfo
public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth) Description copied from interface:java.lang.management.ThreadMXBeanReturns an array ofThreadInfoobjects; one for each of the threads specified in theidsargument. EachThreadInfowill hold details of all of the stack trace information for each specified thread. The returnedThreadInfoobjects will optionally contain details of all monitor objects and synchronizers locked by the corresponding thread. In order to retrieve locked monitor information thelockedMonitorsargument should be set totrue; in order to retrieve locked synchronizers informationlockedSynchronizersshould be set totrue. For a givenThreadInfoelement of the return array the optional information may be inspected by callingThreadInfo.getLockedMonitors()andThreadInfo.getLockedSynchronizers()respectively.Both
lockedMonitorsandlockedSynchronizersarguments should only be set totrueif the virtual machine supports the requested monitoring.- Specified by:
 getThreadInfoin interfaceThreadMXBean- Parameters:
 ids- an array of thread identifiers. Each one must be a positive number greater than zero.lockedMonitors- boolean indication of whether or not each returnedThreadInfoshould hold information on locked object monitorslockedSynchronizers- boolean indication of whether or not each returnedThreadInfoshould hold information on locked synchronizersmaxDepth- limits the number of stack frames returned- Returns:
 - an array of 
ThreadInfoobjects with each entry corresponding to one of the threads specified in the input array of identifiers. The return array will therefore have an identical number of elements to the inputidsarray. If an entry in theidsarray is invalid (there is no living thread with the supplied identifier in the virtual machine) then the corresponding entry in the return array will be anull. 
 - 
getThreadInfo
Returns aThreadInfoobject for the thread with the specified identifier. The stack trace information in the returned object will depend on the value of themaxDepthargument which specifies the maximum number ofStackTraceElementinstances to include. A subsequent call to the returned object'sgetStackTrace()method should then result in aStackTraceElementarray of up tomaxDepthelements. AmaxDepthvalue ofInteger.MAX_VALUEwill obtain all of the stack trace information for the thread while amaxDepthvalue of zero will yield none.It is possible that the virtual machine may be unable to supply any stack trace information for the specified thread. In that case the returned
ThreadInfoobject will have an empty array ofStackTraceElements.The returned object will hold no details of locked synchronizers or locked object monitors for the specified thread; calls to
getLockedMonitors()andgetLockedSynchronizerswill both return array values.- Specified by:
 getThreadInfoin interfaceThreadMXBean- Parameters:
 id- the identifier for a thread. Must be a positive number greater than zero.maxDepth- the maximum number of stack trace entries to be included in the returnedThreadInfoobject. SupplyingInteger.MAX_VALUEobtains all of the stack trace. Only a positive value is expected.- Returns:
 - if the supplied 
idmaps to a living thread in the virtual machine (i.e. a started thread which has not yet died), this method returns aThreadInfoobject corresponding to that thread. Otherwise, returnsnull. 
 - 
getThreadUserTime
public long getThreadUserTime(long id) If supported by the virtual machine, returns the total CPU usage time for the thread with the specified identifier when running in user mode. The returned time will have nanosecond precision but may not have nanosecond accuracy.Method
ThreadMXBean.isThreadCpuTimeSupported()may be used to determine if the CPU timing of threads is supported on the virtual machine. On virtual machines where current thread CPU timing is supported, the methodThreadMXBean.isThreadCpuTimeEnabled()may be used to determine if thread CPU timing is actually enabled.- Specified by:
 getThreadUserTimein interfaceThreadMXBean- Parameters:
 id- the identifier for a thread. Must be a positive number greater than zero.- Returns:
 - on virtual machines where thread CPU timing is supported and
        enabled, and there is a living thread with identifier
        
id, the number of nanoseconds CPU time used by the thread running in user mode. On virtual machines where thread CPU timing is supported but not enabled, or where there is no living thread with identifieridpresent in the virtual machine, a value of-1is returned.If thread CPU timing was disabled when the thread was started then the virtual machine is free to choose any measurement start time between when the virtual machine started up and when thread CPU timing was enabled with a call to
ThreadMXBean.setThreadCpuTimeEnabled(boolean). - See Also:
 
 - 
getTotalStartedThreadCount
public long getTotalStartedThreadCount()Returns the number of threads that have been started in this virtual machine since it came into being.- Specified by:
 getTotalStartedThreadCountin interfaceThreadMXBean- Returns:
 - the total number of started threads.
 
 - 
isCurrentThreadCpuTimeSupported
public boolean isCurrentThreadCpuTimeSupported()Returns a boolean indication of whether or not the virtual machine supports the CPU timing of the current thread.Note that this method must return
trueifThreadMXBean.isThreadCpuTimeSupported()returnstrue.- Specified by:
 isCurrentThreadCpuTimeSupportedin interfaceThreadMXBean- Returns:
 trueif CPU timing of the current thread is supported, otherwisefalse.
 - 
isThreadContentionMonitoringEnabled
public boolean isThreadContentionMonitoringEnabled()Returns a boolean indication of whether or not the monitoring of thread contention situations is enabled on this virtual machine.- Specified by:
 isThreadContentionMonitoringEnabledin interfaceThreadMXBean- Returns:
 trueif thread contention monitoring is enabled,falseotherwise.
 - 
isThreadContentionMonitoringSupported
public boolean isThreadContentionMonitoringSupported()Returns a boolean indication of whether or not the monitoring of thread contention situations is supported on this virtual machine.- Specified by:
 isThreadContentionMonitoringSupportedin interfaceThreadMXBean- Returns:
 trueif thread contention monitoring is supported,falseotherwise.
 - 
isThreadCpuTimeEnabled
public boolean isThreadCpuTimeEnabled()Returns a boolean indication of whether or not the CPU timing of threads is enabled on this virtual machine.- Specified by:
 isThreadCpuTimeEnabledin interfaceThreadMXBean- Returns:
 trueif thread CPU timing is enabled,falseotherwise.- See Also:
 
 - 
isThreadCpuTimeSupported
public boolean isThreadCpuTimeSupported()Returns a boolean indication of whether or not the virtual machine supports the CPU time measurement of any threads (current or otherwise).- Specified by:
 isThreadCpuTimeSupportedin interfaceThreadMXBean- Returns:
 trueif the virtual machine supports the CPU timing of threads,falseotherwise.
 - 
resetPeakThreadCount
public void resetPeakThreadCount()Resets the peak thread count to be the current number of threads alive in the virtual machine when the call is made.- Specified by:
 resetPeakThreadCountin interfaceThreadMXBean
 - 
setThreadContentionMonitoringEnabled
public void setThreadContentionMonitoringEnabled(boolean enable) Updates the virtual machine to either enable or disable the monitoring of thread contention situations.If it is supported, the virtual machine will initially not monitor thread contention situations.
- Specified by:
 setThreadContentionMonitoringEnabledin interfaceThreadMXBean- Parameters:
 enable- enable thread contention monitoring iftrue, otherwise disable thread contention monitoring.- See Also:
 
 - 
setThreadCpuTimeEnabled
public void setThreadCpuTimeEnabled(boolean enable) If supported, updates the virtual machine to either enable or disable the CPU timing of threads.The default value of this property depends on the underlying operating system on which the virtual machine is running.
- Specified by:
 setThreadCpuTimeEnabledin interfaceThreadMXBean- Parameters:
 enable- enable thread CPU timing iftrue, otherwise disable thread CPU timing- See Also:
 
 - 
isObjectMonitorUsageSupported
public boolean isObjectMonitorUsageSupported()Returns a boolean indication of whether or not the virtual machine supports the monitoring of object monitor usage.- Specified by:
 isObjectMonitorUsageSupportedin interfaceThreadMXBean- Returns:
 trueif object monitor usage is permitted, otherwisefalse
 - 
isSynchronizerUsageSupported
public boolean isSynchronizerUsageSupported()Returns a boolean indication of whether or not the virtual machine supports the monitoring of ownable synchronizers (synchronizers that make use of theAbstractOwnableSynchronizertype and which are completely owned by a single thread).- Specified by:
 isSynchronizerUsageSupportedin interfaceThreadMXBean- Returns:
 trueif synchronizer usage monitoring is permitted, otherwisefalse
 - 
findDeadlockedThreads
public long[] findDeadlockedThreads()If supported by the virtual machine, this method can be used to retrieve thelongid of all threads currently waiting on object monitors or ownable synchronizers (synchronizers that make use of theAbstractOwnableSynchronizertype and which are completely owned by a single thread). To determine the threads currently deadlocked by object monitors only use theThreadMXBean.findMonitorDeadlockedThreads()method.It is recommended that this method be used solely for problem determination analysis and not as a means of managing thread synchronization in a virtual machine. This is because the method may be very expensive to run.
- Specified by:
 findDeadlockedThreadsin interfaceThreadMXBean- Returns:
 - an array of the identifiers of every thread in the virtual
        machine that has been detected as currently being in a deadlock
        situation involving object monitors and ownable
        synchronizers. If there are no threads in this category a
        
nullis returned. - See Also:
 
 - 
dumpAllThreads
Returns an array ofThreadInfoobjects holding information on all threads that were alive when the call was invoked.- Specified by:
 dumpAllThreadsin interfaceThreadMXBean- Parameters:
 lockedMonitors- boolean indication of whether or not information on all currently locked object monitors is to be included in the returned arraylockedSynchronizers- boolean indication of whether or not information on all currently locked ownable synchronizers is to be included in the returned array- Returns:
 - an array of 
ThreadInfoobjects 
 - 
dumpAllThreads
public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth) Returns an array ofThreadInfoobjects holding information on all threads that were alive when the call was invoked.- Specified by:
 dumpAllThreadsin interfaceThreadMXBean- Parameters:
 lockedMonitors- boolean indication of whether or not information on all currently locked object monitors is to be included in the returned arraylockedSynchronizers- boolean indication of whether or not information on all currently locked ownable synchronizers is to be included in the returned arraymaxDepth- limits the number of stack frames returned- Returns:
 - an array of 
ThreadInfoobjects 
 - 
getNativeThreadIds
public long[] getNativeThreadIds(long[] threadIDs) throws IllegalArgumentException, SecurityException To satisfy com.ibm.lang.management.ThreadMXBean. - 
getNativeThreadId
To satisfy com.ibm.lang.management. - 
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. 
 
 -