Class ThreadDumper

java.lang.Object
com.atlassian.jira.startup.ThreadDumper
All Implemented Interfaces:
Runnable

public final class ThreadDumper extends Object implements Runnable
A class which takes a thread dump after a specified time. Thread dumping can be cancelled by calling the cancelDump method, which will also cause the thread to finish next time it awakens from sleep. The thread this runs on will sleep until the specified duration has elapsed or this object has been notified to stop waiting. If it is interrupted, it will immediately attempt to dump the thread logs.
Since:
6.4
  • Constructor Details

    • ThreadDumper

      public ThreadDumper(long timeout)
      Parameters:
      timeout - time to wait before logging - if we reach this time and logging has not been cancelled, then threads will be dumped.
  • Method Details

    • cancelDump

      public void cancelDump()
      Cancels thread dumping if the threads have not yet been dumped and calls the notify() method on this object.
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • isLogEnabled

      public boolean isLogEnabled()
    • getTimeout

      public long getTimeout()