public abstract class IndexableTaskItem extends Object implements Indexable, TaskItem, TaskGroup.HasTaskGroup
Constructor and Description |
---|
IndexableTaskItem()
Creates a TaskItem which is index-able using a random UUID.
|
IndexableTaskItem(String key)
Creates a TaskItem which is index-able using provided key.
|
Modifier and Type | Method and Description |
---|---|
protected String |
addDependency(Creatable<? extends Indexable> creatable)
Add a creatable dependency for this task item.
|
protected String |
addDependency(Executable<? extends Indexable> executable)
Add an executable dependency for this task item.
|
protected String |
addDependency(FunctionalTaskItem dependency)
Add a dependency task item for this task item.
|
protected String |
addDependency(TaskGroup.HasTaskGroup dependency)
Add a dependency for this task item.
|
protected String |
addeDependency(Appliable<? extends Indexable> appliable)
Add an appliable dependency for this task item.
|
protected String |
addPostRunDependent(Appliable<? extends Indexable> appliable)
Add an appliable "post-run" dependent for this task item.
|
protected String |
addPostRunDependent(Creatable<? extends Indexable> creatable)
Add a creatable "post-run" dependent for this task item.
|
protected String |
addPostRunDependent(Executable<? extends Indexable> executable)
Add an executable "post-run" dependent for this task item.
|
String |
addPostRunDependent(FunctionalTaskItem dependent)
Add a "post-run" dependent task item for this task item.
|
String |
addPostRunDependent(TaskGroup.HasTaskGroup dependent)
Add a "post-run" dependent for this task item.
|
void |
beforeGroupInvoke()
The method that gets called before invoking all the tasks in the
TaskGroup
this task belongs to. |
void |
clear()
Clear the result produced by the task.
|
static IndexableTaskItem |
create(FunctionalTaskItem taskItem)
Creates an IndexableTaskItem from provided FunctionalTaskItem.
|
rx.Completable |
invokeAfterPostRunAsync(boolean isGroupFaulted)
The method that gets called after invocation of "post run" task items depends on
this TaskItem.
|
rx.Observable<Indexable> |
invokeAsync(TaskGroup.InvocationContext context)
The method that gets called to perform the unit of work asynchronously.
|
protected abstract rx.Observable<Indexable> |
invokeTaskAsync(TaskGroup.InvocationContext context) |
boolean |
isHot() |
String |
key() |
Indexable |
result() |
TaskGroup |
taskGroup() |
protected <T extends Indexable> |
taskResult(String key)
Get result of one of the task that belongs to this task's task group.
|
protected Indexable |
voidIndexable() |
protected rx.Observable<Indexable> |
voidObservable() |
public IndexableTaskItem(String key)
key
- the unique key to index this TaskItempublic IndexableTaskItem()
public static IndexableTaskItem create(FunctionalTaskItem taskItem)
taskItem
- functional TaskItempublic TaskGroup taskGroup()
taskGroup
in interface TaskGroup.HasTaskGroup
public void clear()
protected String addDependency(FunctionalTaskItem dependency)
dependency
- the dependency task item.protected String addDependency(TaskGroup.HasTaskGroup dependency)
dependency
- the dependency.protected String addDependency(Creatable<? extends Indexable> creatable)
creatable
- the creatable dependency.protected String addeDependency(Appliable<? extends Indexable> appliable)
appliable
- the appliable dependency.protected String addDependency(Executable<? extends Indexable> executable)
executable
- the executable dependencypublic String addPostRunDependent(FunctionalTaskItem dependent)
dependent
- the "post-run" dependent task item.public String addPostRunDependent(TaskGroup.HasTaskGroup dependent)
dependent
- the "post-run" dependent.protected String addPostRunDependent(Creatable<? extends Indexable> creatable)
creatable
- the creatable "post-run" dependent.protected String addPostRunDependent(Appliable<? extends Indexable> appliable)
appliable
- the appliable "post-run" dependent.protected String addPostRunDependent(Executable<? extends Indexable> executable)
executable
- the executable "post-run" dependentprotected <T extends Indexable> T taskResult(String key)
T
- the actual type of the task resultkey
- the task keypublic Indexable result()
public void beforeGroupInvoke()
TaskItem
TaskGroup
this task belongs to.beforeGroupInvoke
in interface TaskItem
public boolean isHot()
public rx.Observable<Indexable> invokeAsync(TaskGroup.InvocationContext context)
TaskItem
invokeAsync
in interface TaskItem
context
- the context shared across the the all task items in the group
this task item belongs to.Indexable
public rx.Completable invokeAfterPostRunAsync(boolean isGroupFaulted)
TaskItem
This method will be invoked only if this TaskItem had "post run" dependents.
invokeAfterPostRunAsync
in interface TaskItem
isGroupFaulted
- true if one or more tasks in the group this TaskItem belongs
to are in faulted state.protected abstract rx.Observable<Indexable> invokeTaskAsync(TaskGroup.InvocationContext context)
protected Indexable voidIndexable()
VoidIndexable
with key same as the key of this TaskItem.protected rx.Observable<Indexable> voidObservable()
VoidIndexable
with key same as the key of
this TaskItemCopyright © 2019. All rights reserved.