-
- All Superinterfaces:
PlatformManagedObject
,ThreadMXBean
,ThreadMXBean
- All Known Implementing Classes:
ExtendedThreadMXBeanImpl
public interface ThreadMXBean extends ThreadMXBean
The OpenJ9 extension interface toThreadMXBean
. It publishes APIs specific tocom.ibm.lang.management
, exposing additional information than what the standard ThreadMXBean does.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExtendedThreadInfo[]
dumpAllExtendedThreads(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.long
getNativeThreadId(long threadId)
Find the native (operating system assigned) thread identifiers corresponding to a unique TID (as returned by java/lang/Thread.getId()).long[]
getNativeThreadIds(long[] threadIDs)
Fetches an array of the native (operating system assigned) identifiers corresponding to unique TIDs (as returned by java/lang/Thread.getId()) specified to it.-
Methods declared in interface java.lang.management.PlatformManagedObject
getObjectName
-
Methods declared in interface com.sun.management.ThreadMXBean
getCurrentThreadAllocatedBytes, getThreadAllocatedBytes, getThreadAllocatedBytes, getThreadCpuTime, getThreadUserTime, getTotalThreadAllocatedBytes, isThreadAllocatedMemoryEnabled, isThreadAllocatedMemorySupported, setThreadAllocatedMemoryEnabled
-
Methods declared in interface java.lang.management.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 Detail
-
getNativeThreadIds
long[] getNativeThreadIds(long[] threadIDs) throws IllegalArgumentException, SecurityException
Fetches an array of the native (operating system assigned) identifiers corresponding to unique TIDs (as returned by java/lang/Thread.getId()) specified to it.- Parameters:
threadIDs
- An array of thread identifiers that the user wishes to obtain native thread identifiers for.- Returns:
- An array of operating system assigned native thread identifiers. If a thread among the given set of IDs is no longer alive or does not exist, a -1 is set in the corresponding element of the returned array.
- Throws:
IllegalArgumentException
- is thrown if any of the thread identifiers passed is invalid (<=0).SecurityException
- is thrown if the caller does not have sufficient permissions (ManagementPermission("monitor"))
-
getNativeThreadId
long getNativeThreadId(long threadId) throws IllegalArgumentException, SecurityException
Find the native (operating system assigned) thread identifiers corresponding to a unique TID (as returned by java/lang/Thread.getId()). When querying multiple threadIDs, consider using getNativeThreadIds(long[]) as it is more efficient than getNativeThreadId().- Parameters:
threadId
- The Java runtime allocated thread identifier.- Returns:
- Operating system assigned native thread identifier. If the thread corresponding to the ID is no longer alive or does not exist, -1 is returned.
- Throws:
IllegalArgumentException
- is thrown if the thread identifier passed is invalid (<=0).SecurityException
- is thrown if the caller does not have sufficient permissions (ManagementPermission("monitor"))
-
dumpAllExtendedThreads
ExtendedThreadInfo[] dumpAllExtendedThreads(boolean lockedMonitors, boolean lockedSynchronizers) throws SecurityException, UnsupportedOperationException, InternalError
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.- 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:
SecurityException
- is thrown if the caller does not have sufficient permissions (ManagementPermission("monitor"))UnsupportedOperationException
- is thrown if the JVM does not support monitoring object monitor usage or ownable synchronizer usage, even as it has been specified.InternalError
- is thrown in case an error occurs while fetching thread information, typically, an internal error resulting from an inconsistency in the class library.
-
-