public abstract class TerminatableRunnable extends Object implements Runnable
Constructor and Description |
---|
TerminatableRunnable(ScheduledExecutorService scheduler,
long initialDelay,
long delay,
TimeUnit unit) |
Modifier and Type | Method and Description |
---|---|
void |
blockTillTerminated()
Unschedule next launched, and wait for the current task to complete before closing it.
|
protected abstract void |
doRun() |
boolean |
isUnschedule() |
void |
run() |
void |
unscheduleTask()
Unschedule task if active.
|
public TerminatableRunnable(ScheduledExecutorService scheduler, long initialDelay, long delay, TimeUnit unit)
protected abstract void doRun()
public void blockTillTerminated()
public boolean isUnschedule()
public void unscheduleTask()
Copyright © 2016. All rights reserved.