Class TerminableRunnable
java.lang.Object
org.mariadb.jdbc.internal.failover.thread.TerminableRunnable
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
FailoverLoop
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicReference<TerminableRunnable.State>
private ScheduledFuture<?>
private final AtomicBoolean
-
Constructor Summary
ConstructorsConstructorDescriptionTerminableRunnable
(ScheduledExecutorService scheduler, long initialDelay, long delay, TimeUnit unit) -
Method Summary
-
Field Details
-
runState
-
unschedule
-
scheduledFuture
-
-
Constructor Details
-
TerminableRunnable
public TerminableRunnable(ScheduledExecutorService scheduler, long initialDelay, long delay, TimeUnit unit)
-
-
Method Details
-
doRun
protected abstract void doRun() -
run
public final void run() -
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.
-