Class CommandChain.MonitorThread

java.lang.Object
java.lang.Thread
org.codelibs.fess.auth.chain.CommandChain.MonitorThread
All Implemented Interfaces:
Runnable
Enclosing class:
CommandChain

protected static class CommandChain.MonitorThread extends Thread
Monitor thread that handles process timeout and termination. This thread sleeps for the specified timeout duration and terminates the process if it hasn't finished.
  • Constructor Details

    • MonitorThread

      public MonitorThread(Process process, long timeout)
      Constructor for MonitorThread.
      Parameters:
      process - The process to monitor.
      timeout - The timeout duration in milliseconds.
  • Method Details

    • run

      public void run()
      Runs the monitor thread, sleeping for the timeout duration and terminating the process if needed.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • setFinished

      public void setFinished(boolean finished)
      Sets the finished flag to indicate whether the process has completed.
      Parameters:
      finished - True if the process has finished, false otherwise.
    • isTeminated

      public boolean isTeminated()
      Checks if the process has been terminated due to timeout.
      Returns:
      True if the process was terminated, false otherwise.