Package org.codelibs.fess.auth.chain
Class CommandChain.MonitorThread
java.lang.Object
java.lang.Thread
org.codelibs.fess.auth.chain.CommandChain.MonitorThread
- All Implemented Interfaces:
Runnable
- Enclosing class:
CommandChain
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the process has been terminated due to timeout.voidrun()Runs the monitor thread, sleeping for the timeout duration and terminating the process if needed.voidsetFinished(boolean finished) Sets the finished flag to indicate whether the process has completed.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Constructor Details
-
MonitorThread
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. -
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.
-