Class ThreadMonitor


  • public class ThreadMonitor
    extends java.lang.Object
    Example of using the java.lang.management API to dump stack trace and to perform deadlock detection.
    Version:
    %% 12/22/05
    • Constructor Summary

      Constructors 
      Constructor Description
      ThreadMonitor()
      Constructs a ThreadMonitor object to get thread information in the local JVM.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String findDeadlock()
      Checks if any threads are deadlocked.
      java.lang.String threadDump()
      Prints the thread dump information to System.out.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ThreadMonitor

        public ThreadMonitor()
        Constructs a ThreadMonitor object to get thread information in the local JVM.
    • Method Detail

      • threadDump

        public java.lang.String threadDump()
        Prints the thread dump information to System.out.
        Returns:
        the thread dump information.
      • findDeadlock

        public java.lang.String findDeadlock()
        Checks if any threads are deadlocked. If any, print the thread dump information.