public abstract class AbstractTaskManager extends Object implements TaskManager
| Constructor and Description |
|---|
AbstractTaskManager() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
executeRecurring(UUID uuid,
BackgroundTask task,
long delay,
long interval) |
protected abstract void |
executeSingle(UUID uuid,
BackgroundTask task,
long delay) |
protected abstract ScheduledFuture<BackgroundTask> |
getTaskExecutionStatus(UUID uuid) |
protected abstract BackgroundTask |
instantiateTask(String className) |
protected abstract UUID |
saveNewState(TaskState state) |
UUID |
scheduleRecurringTask(BackgroundTask task,
long delay,
long interval)
Schedule a task for recurring execution at every @period interval and after an initial @delay.
|
UUID |
scheduleTask(BackgroundTask task,
long delay)
Schedule a single shot/one off BackgroundTask to run after a @delay in milliseconds.
|
TaskManager |
stopTask(UUID uuid,
String requesterName,
String message)
Stop a Scheduled, Paused or Running task.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllTasks, getTasks, getTaskStatepublic UUID scheduleTask(BackgroundTask task, long delay)
TaskManagerscheduleTask in interface TaskManagertask - Any object implementing the BackgroundTask interface that is to be scheduled for later execution.delay - Delay after which the @task object should be executed, may be null.public UUID scheduleRecurringTask(BackgroundTask task, long delay, long interval)
TaskManagerscheduleRecurringTask in interface TaskManagertask - Any object implementing the BackgroundTask interface that is to be scheduled for later execution.delay - Long delay after which the @task object should be executed, may be null.interval - Long interval between subsequent calls to @task.start().public TaskManager stopTask(UUID uuid, String requesterName, String message)
TaskManagerstopTask in interface TaskManageruuid - UUID of task to stop.requesterName - Optional String to denote who requested this call; used for status reporting and may be null.message - Optional String denoting the reason for stopping the task; used for status reporting and may be null.protected abstract ScheduledFuture<BackgroundTask> getTaskExecutionStatus(UUID uuid)
protected abstract void executeSingle(UUID uuid, BackgroundTask task, long delay)
protected abstract void executeRecurring(UUID uuid, BackgroundTask task, long delay, long interval)
protected abstract BackgroundTask instantiateTask(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
Copyright © 2016 Grakn Labs Ltd. All rights reserved.