public interface ITask
| Modifier and Type | Method and Description |
|---|---|
ITask |
after(Object pojoTask)
The inverse of
before(Object), achieving the same effect while
allowing the arguments to be reversed. |
ITask |
before(Object pojoTask)
Ensures this task completes before the given task.
|
ITask |
fork()
Prevents this task from being run by the calling thread, spawning a new
thread if needed.
|
String |
getName()
The name of this pojoCalled instance in an orchestrator, guaranteed to
always be unique that orchestrator.
|
Orchestrator |
getOrchestrator()
Returns the orchestrator which created and owns this task.
|
boolean |
isFork()
Should this task not be run in the calling thread?
|
boolean |
isMultiMethodOk()
Should an exception be thrown when a task has more than one method each
of which has all parameters added to the graph?
|
boolean |
isWait()
Should the orchestrator wait for this task to finish before completing an
invocation of the
Orchestrator.execute() method? |
ITask |
multiMethodOk()
Indicates that it is ok if the task has more than one method which can
fire.
|
ITask |
name(String name)
Each task has a name that defaults to its type name followed by a unique
integer for that type, unless overridden here.
|
ITask |
noWait()
Convenience method for setWait(false);
|
ITask |
provides(Class<?> pojoTaskClass)
Indicates that a task will add to the current orchestrator a pojo task
instance of the given class.
|
ITask |
wait(boolean wait)
Specifies whether the orchestrator should wait for this instance to
finish.
|
Orchestrator getOrchestrator()
Orchestrator.addWork(Object),
Orchestrator.addPassThru(Object),
Orchestrator.addConditionally(Object,
boolean)String getName()
ITask name(String name)
name - new name for task, any previous nameInvalidTask.NameConflict - if a task with this name already existsboolean isWait()
Orchestrator.execute() method?ITask wait(boolean wait)
isWait()==true.wait - behavior on orchestrator execute() exitOrchestrator.execute()ITask noWait()
ITask multiMethodOk()
boolean isMultiMethodOk()
ITask fork()
boolean isFork()
ITask before(Object pojoTask)
a1.before(b),
then the B instance b would only depend on that singular A instances a1.
This method can safely be called before pojoTask is added to
the graph, but will result in an error on the next
Orchestrator.execute() if
pojoTask has not been added by that time.
pojoTask - or ITask which should run before this one is startedITask after(Object pojoTask)
before(Object), achieving the same effect while
allowing the arguments to be reversed.pojoTask - or ITask which should only run after this oneITask provides(Class<?> pojoTaskClass)
Orchestrator.execute() will
fail at the outer level, asserting that the graph is incomplete -- the
orchestrator has no way to peer inside the inner task code to determine
when/if an instance will be added.
If the nested task does not in fact add the promised instance, an exception will be throw when it terminates.
pojoTaskClass - for task that will be provided when this task is
invokedCopyright © 2018. All rights reserved.