Class ThreadDescriptor

java.lang.Object
com.helger.xml.util.thread.ThreadDescriptor
All Implemented Interfaces:
IHasMicroNodeRepresentation

public class ThreadDescriptor extends Object implements IHasMicroNodeRepresentation
This class contains the information of a single thread at a certain point of time.
Author:
Philip Helger
  • Field Details

    • DEFAULT_ENABLE_THREAD_INFO

      public static final boolean DEFAULT_ENABLE_THREAD_INFO
      See Also:
  • Constructor Details

  • Method Details

    • setEnableThreadInfo

      public static void setEnableThreadInfo(boolean bEnableThreadInfo)
      Enable the retrieval of ThreadInfo objects. Warning: this takes a lot of CPU, so enable this only when you are not running a performance critical application! The default is false.
      Parameters:
      bEnableThreadInfo - true to enabled, false to disable.
    • isEnableThreadInfo

      public static boolean isEnableThreadInfo()
    • getThreadID

      public long getThreadID()
    • getThreadState

      public Thread.State getThreadState()
    • getDescriptor

      @Nonnull @Nonempty public String getDescriptor()
    • getStackTrace

      @Nullable public String getStackTrace()
    • getStackTraceNotNull

      @Nonnull @Nonempty public String getStackTraceNotNull()
    • getLockInfo

      @Nonnull public String getLockInfo()
    • getAsString

      @Nonnull @Nonempty public String getAsString()
    • getAsMicroNode

      @Nonnull public IMicroElement getAsMicroNode()
      Specified by:
      getAsMicroNode in interface IHasMicroNodeRepresentation
      Returns:
      this as an IMicroNode. May not be null.
    • createForCurrentThread

      @Nonnull public static ThreadDescriptor createForCurrentThread(@Nullable Throwable t)