public class ThreadPauserImpl extends Object implements ThreadPauser
Modifier and Type | Method and Description |
---|---|
long |
currentPauseLength()
How long has this job been paused for currently?
This does not include any previous pauses.
|
long |
currentRunPhaseLength()
How long has this job been running currently?
This does not include any previous running phases.
|
boolean |
isPaused()
Is this operation currently paused?
|
void |
pause(boolean paused)
Pause or unpause this operation.
|
long |
pausedTotal()
How long has this job been paused in total?
|
static void |
setEnabled(boolean enabled) |
void |
waitIfPaused()
If the thread we're controlling is supposed to be paused, wait until it is
unpaused or it's interrupted.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create
public static void setEnabled(boolean enabled)
enabled
- Do we want to enable this functionality? (default: false)public void waitIfPaused() throws InterruptedException
ThreadPauser
waitIfPaused
in interface ThreadPauser
InterruptedException
- if thread was interrupted from elsewhere (e.g. load manager)public void pause(boolean paused)
Pausible
pause
in interface Pausible
pause
in interface ThreadPauser
paused
- if true, pause the operation; if false, unpause itpublic boolean isPaused()
Pausible
isPaused
in interface Pausible
isPaused
in interface ThreadPauser
public long currentPauseLength()
ThreadPauser
currentPauseLength
in interface ThreadPauser
public long currentRunPhaseLength()
ThreadPauser
currentRunPhaseLength
in interface ThreadPauser
public long pausedTotal()
ThreadPauser
pausedTotal
in interface ThreadPauser
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.