Name
ThreadInfo
Synopsis
This
class represents information about a
thread from a ThreadMXBean. Some information, such
as thread name, id, state, and stack trace are also available through
the java.lang.Thread object. Other more useful
information includes the object upon which a thread is waiting and
the owner of the lock that the thread is trying to acquire. If
ThreadMXBean indicates that thread contention
monitoring is supported and enabled, the
ThreadInfo methods getBlockedCount(
)
and getBlockedTime(
) return the number of times the thread has blocked or
waited and the amount of time it has spent in the blocked and waiting
states.
public class ThreadInfo { // No Constructor // Public Class Methods public static ThreadInfo from(javax.management.openmbean.CompositeData cd); // Public Instance Methods public long getBlockedCount( ); public long getBlockedTime( ); public String getLockName( ); public long getLockOwnerId( ); public String getLockOwnerName( ); public StackTraceElement[ ] getStackTrace( ); public long getThreadId( ); public String getThreadName( ); public Thread.State getThreadState( ); public long getWaitedCount( ); public long getWaitedTime( ); public boolean isInNative( ); public boolean isSuspended( ); // Public Methods Overriding Object public String toString( ); }
Returned By
ThreadMXBean.getThreadInfo( )
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access