-
- All Superinterfaces:
PlatformManagedObject
- All Known Subinterfaces:
ThreadMXBean,ThreadMXBean
public interface ThreadMXBean extends PlatformManagedObject
The management and monitoring interface for the threading system of the virtual machine.Precisely one instance of this interface will be made available to management clients.
Accessing this
MXBeancan be done in one of three ways.- Invoking the static
ManagementFactory.getThreadMXBean()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=Threading" for the value of the second parameter.
- Since:
- 1.5
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ThreadInfo[]dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers)Returns an array ofThreadInfoobjects holding information on all threads that were alive when the call was invoked.default 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.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).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.long[]getAllThreadIds()Returns an array of the identifiers of all of the threads that are alive in the current virtual machine.longgetCurrentThreadCpuTime()If supported by the virtual machine, returns the total CPU usage time for the currently running thread.longgetCurrentThreadUserTime()If supported by the virtual machine, returns the total CPU usage time for the current thread running in user mode.intgetDaemonThreadCount()Returns the number of daemon threads currently alive in the virtual machine.intgetPeakThreadCount()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.intgetThreadCount()Returns 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.ThreadInfogetThreadInfo(long id)Returns aThreadInfoobject for the thread with the specified identifier.ThreadInfo[]getThreadInfo(long[] ids)Returns an array ofThreadInfoobjects ; one for each of the threads specified in the input array of identifiers.ThreadInfo[]getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers)Returns an array ofThreadInfoobjects; one for each of the threads specified in theidsargument.default ThreadInfo[]getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth)Returns an array ofThreadInfoobjects; one for each of the threads specified in theidsargument.ThreadInfo[]getThreadInfo(long[] ids, int maxDepth)Returns an array ofThreadInfoobjects ; one for each of the threads specified in theidsargument.ThreadInfogetThreadInfo(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.longgetTotalStartedThreadCount()Returns the number of threads that have been started in this virtual machine since it came into being.booleanisCurrentThreadCpuTimeSupported()Returns a boolean indication of whether or not the virtual machine supports the CPU timing of the current thread.booleanisObjectMonitorUsageSupported()Returns a boolean indication of whether or not the virtual machine supports the monitoring of object monitor usage.booleanisSynchronizerUsageSupported()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).booleanisThreadContentionMonitoringEnabled()Returns a boolean indication of whether or not the monitoring of thread contention situations is enabled on this virtual machine.booleanisThreadContentionMonitoringSupported()Returns a boolean indication of whether or not the monitoring of thread contention situations is supported on this virtual machine.booleanisThreadCpuTimeEnabled()Returns a boolean indication of whether or not the CPU timing of threads is enabled on this virtual machine.booleanisThreadCpuTimeSupported()Returns a boolean indication of whether or not the virtual machine supports the CPU time measurement of any threads (current or otherwise).voidresetPeakThreadCount()Resets the peak thread count to be the current number of threads alive in the virtual machine when the call is made.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 interface java.lang.management.PlatformManagedObject
getObjectName
-
-
-
-
Method Detail
-
findMonitorDeadlockedThreads
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 thefindDeadlockedThreads()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.
- 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. - Throws:
SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "monitor".
-
getAllThreadIds
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.- Returns:
- the identifiers of all of the threads currently alive in the virtual machine.
-
getCurrentThreadCpuTime
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
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 methodisThreadCpuTimeEnabled()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
getThreadCpuTime(long)with an argumentThread.currentThread().getId()).- 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. - Throws:
UnsupportedOperationException- if the virtual machine does not support current thread CPU timing.
-
getCurrentThreadUserTime
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
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 methodisThreadCpuTimeEnabled()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
getThreadUserTime(long)with an argumentThread.currentThread().getId()).- 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. - Throws:
UnsupportedOperationException- if the virtual machine does not support current thread CPU timing.
-
getDaemonThreadCount
int getDaemonThreadCount()
Returns the number of daemon threads currently alive in the virtual machine.- Returns:
- the number of currently alive daemon threads.
-
getPeakThreadCount
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.- Returns:
- the peak number of live threads
- See Also:
resetPeakThreadCount()
-
getThreadCount
int getThreadCount()
Returns the number of threads currently alive in the virtual machine. This includes both daemon threads and non-daemon threads.- Returns:
- the number of currently alive threads.
-
getThreadCpuTime
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
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 methodisThreadCpuTimeEnabled()may be used to determine if thread CPU timing is actually enabled.- 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. - Throws:
IllegalArgumentException- ifidis <=0.UnsupportedOperationException- if the virtual machine does not support thread CPU timing.- See Also:
isThreadCpuTimeSupported(),isThreadCpuTimeEnabled()
-
getThreadInfo
ThreadInfo getThreadInfo(long id)
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.- 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. - Throws:
IllegalArgumentException- ifidis <=0.SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "monitor".
-
getThreadInfo
ThreadInfo[] getThreadInfo(long[] ids)
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.- 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. - Throws:
IllegalArgumentException- if any of the entries in theidsarray is <=0.SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "monitor".
-
getThreadInfo
ThreadInfo[] getThreadInfo(long[] ids, int maxDepth)
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.- 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). - Throws:
IllegalArgumentException- if any element inidsis <=0.IllegalArgumentException- ifmaxDepthis <0.SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "monitor".
-
getThreadInfo
ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers)
Returns 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.- 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 synchronizers- 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. - Throws:
IllegalArgumentException- if any of the entries in theidsarray is <=0.SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "monitor".UnsupportedOperationException- if either of the following conditions apply:lockedMonitorsistruebut a call toisObjectMonitorUsageSupported()would result in afalsevaluelockedSynchronizersistruebut a call toisSynchronizerUsageSupported()would result in afalsevalue
-
getThreadInfo
ThreadInfo getThreadInfo(long id, int maxDepth)
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.- 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. - Throws:
IllegalArgumentException- ifidis <=0.IllegalArgumentException- ifmaxDepthis <0.SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "monitor".
-
getThreadUserTime
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
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 methodisThreadCpuTimeEnabled()may be used to determine if thread CPU timing is actually enabled.- 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
setThreadCpuTimeEnabled(boolean). - Throws:
IllegalArgumentException- ifidis <=0.UnsupportedOperationException- if the virtual machine does not support thread CPU timing.- See Also:
isThreadCpuTimeSupported(),isThreadCpuTimeEnabled()
-
getTotalStartedThreadCount
long getTotalStartedThreadCount()
Returns the number of threads that have been started in this virtual machine since it came into being.- Returns:
- the total number of started threads.
-
isCurrentThreadCpuTimeSupported
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
trueifisThreadCpuTimeSupported()returnstrue.- Returns:
trueif CPU timing of the current thread is supported, otherwisefalse.
-
isThreadContentionMonitoringEnabled
boolean isThreadContentionMonitoringEnabled()
Returns a boolean indication of whether or not the monitoring of thread contention situations is enabled on this virtual machine.- Returns:
trueif thread contention monitoring is enabled,falseotherwise.
-
isThreadContentionMonitoringSupported
boolean isThreadContentionMonitoringSupported()
Returns a boolean indication of whether or not the monitoring of thread contention situations is supported on this virtual machine.- Returns:
trueif thread contention monitoring is supported,falseotherwise.
-
isThreadCpuTimeEnabled
boolean isThreadCpuTimeEnabled()
Returns a boolean indication of whether or not the CPU timing of threads is enabled on this virtual machine.- Returns:
trueif thread CPU timing is enabled,falseotherwise.- Throws:
UnsupportedOperationException- if the virtual machine does not support thread CPU timing.- See Also:
isThreadCpuTimeSupported()
-
isThreadCpuTimeSupported
boolean isThreadCpuTimeSupported()
Returns a boolean indication of whether or not the virtual machine supports the CPU time measurement of any threads (current or otherwise).- Returns:
trueif the virtual machine supports the CPU timing of threads,falseotherwise.
-
resetPeakThreadCount
void resetPeakThreadCount()
Resets the peak thread count to be the current number of threads alive in the virtual machine when the call is made.- Throws:
SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "control".
-
setThreadContentionMonitoringEnabled
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.
- Parameters:
enable- enable thread contention monitoring iftrue, otherwise disable thread contention monitoring.- Throws:
SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "control".UnsupportedOperationException- if the virtual machine does not support thread contention monitoring.- See Also:
isThreadContentionMonitoringSupported()
-
setThreadCpuTimeEnabled
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.
- Parameters:
enable- enable thread CPU timing iftrue, otherwise disable thread CPU timing- Throws:
SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "control".UnsupportedOperationException- if the virtual machine does not support thread CPU timing.- See Also:
isThreadCpuTimeSupported()
-
isObjectMonitorUsageSupported
boolean isObjectMonitorUsageSupported()
Returns a boolean indication of whether or not the virtual machine supports the monitoring of object monitor usage.- Returns:
trueif object monitor usage is permitted, otherwisefalse- Since:
- 1.6
-
isSynchronizerUsageSupported
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).- Returns:
trueif synchronizer usage monitoring is permitted, otherwisefalse
-
findDeadlockedThreads
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 thefindMonitorDeadlockedThreads()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.
- 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. - Throws:
SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "monitor".UnsupportedOperationException- if the virtual machine does not support any monitoring of ownable synchronizers.- See Also:
isSynchronizerUsageSupported()
-
dumpAllThreads
ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers)
Returns an array ofThreadInfoobjects holding information on all threads that were alive when the call was invoked.- 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 - Throws:
SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "monitor".UnsupportedOperationException- if either of the following conditions apply:lockedMonitorsistruebut a call toisObjectMonitorUsageSupported()would result in afalsevaluelockedSynchronizersistruebut a call toisSynchronizerUsageSupported()would result in afalsevalue
-
dumpAllThreads
default 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.- 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 - Throws:
SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "monitor".UnsupportedOperationException- if either of the following conditions apply:lockedMonitorsistruebut a call toisObjectMonitorUsageSupported()would result in afalsevaluelockedSynchronizersistruebut a call toisSynchronizerUsageSupported()would result in afalsevalue
- Since:
- 10
-
getThreadInfo
default ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors, boolean lockedSynchronizers, int maxDepth)
Returns 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.- 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. - Throws:
IllegalArgumentException- if any of the entries in theidsarray is <=0.SecurityException- if there is a security manager in effect and the caller does not haveManagementPermissionof "monitor".UnsupportedOperationException- if either of the following conditions apply:lockedMonitorsistruebut a call toisObjectMonitorUsageSupported()would result in afalsevaluelockedSynchronizersistruebut a call toisSynchronizerUsageSupported()would result in afalsevalue
- Since:
- 10
-
-