public abstract class MockBackgroundTask extends BackgroundTask
| Modifier and Type | Field and Description |
|---|---|
protected AtomicBoolean |
cancelled |
protected Object |
sync |
| Constructor and Description |
|---|
MockBackgroundTask() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.common.collect.ImmutableMultiset<TaskId> |
cancelledTasks() |
static void |
clearTasks() |
static com.google.common.collect.ImmutableMultiset<TaskId> |
completedTasks() |
protected abstract void |
executeStartInner(TaskId id) |
boolean |
start()
Called to start execution of the task, may be called on a newly scheduled or previously stopped task.
|
boolean |
stop()
Called to stop execution of the task, may be called on a running or paused task.
|
static void |
whenTaskFinishes(java.util.function.Consumer<TaskId> onTaskFinish) |
static void |
whenTaskStarts(java.util.function.Consumer<TaskId> beforeTaskStarts) |
configuration, engineConfiguration, factory, initialize, metricRegistry, postProcessorprotected final AtomicBoolean cancelled
protected final Object sync
public static com.google.common.collect.ImmutableMultiset<TaskId> completedTasks()
public static com.google.common.collect.ImmutableMultiset<TaskId> cancelledTasks()
public static void whenTaskStarts(java.util.function.Consumer<TaskId> beforeTaskStarts)
public static void whenTaskFinishes(java.util.function.Consumer<TaskId> onTaskFinish)
public static void clearTasks()
public final boolean start()
BackgroundTaskstart in class BackgroundTaskpublic final boolean stop()
BackgroundTask
This implementation always throws UnsupportedOperationException.
stop in class BackgroundTaskprotected abstract void executeStartInner(TaskId id)
Copyright © 2017 Grakn Labs Ltd. All rights reserved.