Class TerminationMonitor

java.lang.Object
java.lang.Thread
de.aristaflow.adept2.core.registry.TerminationMonitor
All Implemented Interfaces:
Runnable

public class TerminationMonitor extends Thread
Simple shutdown monitor, which allows for watching
  • Field Details

    • MSG_DUMP

      protected static final String MSG_DUMP
      Message template for dumping running threads.
      See Also:
    • MSG_TERMINATION

      protected static final String MSG_TERMINATION
      Message template for forcing termination.
      See Also:
    • dumpIntervalSeconds

      protected final long dumpIntervalSeconds
      In an interval of the given amount of seconds, the thread will perform an informational thread dump which allows to analyse the situation.
    • exitSeconds

      protected final int exitSeconds
      If a value > 0 is provided, the thread will use System.exit(1) to terminate the Java process.
    • output

      protected final PrintStream output
      Stream where to print thread dumps to.
  • Constructor Details

    • TerminationMonitor

      public TerminationMonitor(PrintStream output, int threadDumpIntervalSeconds, int systemExitSeconds)
      Parameters:
      output - Stream where to print thread dumps to.
      threadDumpIntervalSeconds - In an interval of the given amount of seconds, the thread will perform an informational thread dump which allows to analyse the situation.
      systemExitSeconds - If a value > 0 is provided, the thread will use System.exit(1) to terminate the Java process.
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread