Interface ThreadMXBean

All Superinterfaces:
PlatformManagedObject, ThreadMXBean, ThreadMXBean
All Known Implementing Classes:
ExtendedThreadMXBeanImpl

public interface ThreadMXBean extends ThreadMXBean
The OpenJ9 extension interface to ThreadMXBean. It publishes APIs specific to com.ibm.lang.management, exposing additional information than what the standard ThreadMXBean does.
  • Method Details

    • 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 array
      lockedSynchronizers - 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.