| Constructor and Description |
|---|
KafkaScheduler(int threads) |
KafkaScheduler(int threads,
boolean daemon) |
KafkaScheduler(int threads,
boolean daemon,
String threadNamePrefix) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isStarted() |
void |
resizeThreadPool(int newSize) |
ScheduledFuture<?> |
schedule(String name,
Runnable task,
long delayMs,
long periodMs)
Schedule a task.
|
void |
shutdown()
Shutdown this scheduler.
|
void |
startup()
Initialize this scheduler so it is ready to accept scheduling of tasks
|
boolean |
taskRunning(ScheduledFuture<?> task) |
String |
threadNamePrefix() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitscheduleOnce, scheduleOncepublic KafkaScheduler(int threads)
public KafkaScheduler(int threads,
boolean daemon)
public KafkaScheduler(int threads,
boolean daemon,
String threadNamePrefix)
public void startup()
Schedulerpublic void shutdown()
throws InterruptedException
Schedulershutdown in interface SchedulerInterruptedExceptionpublic ScheduledFuture<?> schedule(String name, Runnable task, long delayMs, long periodMs)
Schedulerschedule in interface Schedulername - The name of this tasktask - The task to rundelayMs - The number of milliseconds to wait before the first executionperiodMs - The period in milliseconds with which to execute the task. If < 0 the task will execute only once.public final boolean isStarted()
public void resizeThreadPool(int newSize)
resizeThreadPool in interface Schedulerpublic String threadNamePrefix()
public boolean taskRunning(ScheduledFuture<?> task)