Package org.zaproxy.zap.utils
Interface PausableExecutorService
-
- All Superinterfaces:
java.util.concurrent.Executor
,java.util.concurrent.ExecutorService
- All Known Implementing Classes:
PausableScheduledThreadPoolExecutor
,PausableThreadPoolExecutor
public interface PausableExecutorService extends java.util.concurrent.ExecutorService
AExecutorService
that allows to pause and resume. Moreover it allows to listen for termination of the executor.- Since:
- 2.4.0
- See Also:
ExecutorTerminatedListener
,pause()
,addExecutorTerminatedListener(ExecutorTerminatedListener)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addExecutorTerminatedListener(ExecutorTerminatedListener listener)
Adds the givenlistener
to the list of listeners that will be notified when the executor terminates.void
pause()
Pauses the executor, so that no new task will be executed untilresume()
is called.void
removeExecutorTerminatedListener(ExecutorTerminatedListener listener)
Removes the givenlistener
from the list of listeners that are notified when the executor terminates.void
resume()
Resumes the executor, so that the awaiting tasks are executed.
-
-
-
Method Detail
-
pause
void pause()
Pauses the executor, so that no new task will be executed untilresume()
is called.- See Also:
resume()
-
resume
void resume()
Resumes the executor, so that the awaiting tasks are executed.The call to this method has no effect if the executor is not paused.
- See Also:
pause()
-
addExecutorTerminatedListener
void addExecutorTerminatedListener(ExecutorTerminatedListener listener)
Adds the givenlistener
to the list of listeners that will be notified when the executor terminates.- Parameters:
listener
- the listener for termination- See Also:
ExecutorService.isTerminated()
,removeExecutorTerminatedListener(ExecutorTerminatedListener)
-
removeExecutorTerminatedListener
void removeExecutorTerminatedListener(ExecutorTerminatedListener listener)
Removes the givenlistener
from the list of listeners that are notified when the executor terminates.- Parameters:
listener
- the listener for termination- See Also:
ExecutorService.isTerminated()
,addExecutorTerminatedListener(ExecutorTerminatedListener)
-
-