public abstract class ScheduledTask extends Object implements Closeable, Runnable
| Modifier | Constructor and Description |
|---|---|
protected |
ScheduledTask(ScheduledExecutorService executor)
Creates a new
ScheduledTask instance. |
protected |
ScheduledTask(String name)
Creates a new
ScheduledTask instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Stops the task and shuts down its thread of execution.
|
void |
start(long period,
TimeUnit unit)
Starts the tasks with the given period.
|
void |
stop()
Stops the task and shuts down its thread of execution.
|
protected ScheduledTask(String name)
ScheduledTask instance.name - the task's nameprotected ScheduledTask(ScheduledExecutorService executor)
ScheduledTask instance.executor - the executor to use while scheduling tasks.public void start(long period,
TimeUnit unit)
period - the amount of time between each rununit - the unit for periodpublic void stop()
public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2014–2019 WSO2. All rights reserved.