Class TerminableRunnable
- java.lang.Object
-
- org.mariadb.jdbc.internal.failover.thread.TerminableRunnable
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
FailoverLoop
public abstract class TerminableRunnable extends Object implements Runnable
-
-
Constructor Summary
Constructors Constructor Description TerminableRunnable(ScheduledExecutorService scheduler, long initialDelay, long delay, TimeUnit unit)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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, and cancel thread to inform it must be interrupted in a proper way.
-
-
-
Constructor Detail
-
TerminableRunnable
public TerminableRunnable(ScheduledExecutorService scheduler, long initialDelay, long delay, TimeUnit unit)
-
-
Method Detail
-
doRun
protected abstract void doRun()
-
blockTillTerminated
public void blockTillTerminated()
Unschedule next launched, and wait for the current task to complete before closing it.
-
isUnschedule
public boolean isUnschedule()
-
unscheduleTask
public void unscheduleTask()
Unschedule task if active, and cancel thread to inform it must be interrupted in a proper way.
-
-