org.mariadb.jdbc.internal.failover.thread

## Class TerminatableRunnable

- java.lang.Object
- - org.mariadb.jdbc.internal.failover.thread.TerminatableRunnable

All Implemented Interfaces:
  Runnable

Direct Known Subclasses:
  FailoverLoop

    public abstract class TerminatableRunnable
    extends Object
    implements Runnable

### Constructor Summary

Constructors
Constructor and Description
`TerminatableRunnable(ScheduledExecutorService scheduler, long initialDelay, long delay, TimeUnit unit)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### TerminatableRunnable

    public TerminatableRunnable(ScheduledExecutorService scheduler,
                                long initialDelay,
                                long delay,
                                TimeUnit unit)

### Method Detail

#### doRun

    protected abstract void doRun()

#### run

    public final void run()

Specified by:
  `run` in interface `Runnable`

#### 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.