Modifier and Type | Method and Description |
---|---|
FlowFuture |
doFlow(F key,
Object parameter)
Instigates a
JobSequence to be run. |
FlowFuture |
doFlow(int flowIndex,
Object parameter)
Similar to
doFlow(Enum, Object) except that allows dynamic
instigation of flows. |
void |
doFlow(String workName,
String taskName,
Object parameter)
|
Object |
getObject(D key)
Obtains the dependency object.
|
Object |
getObject(int dependencyIndex)
Similar to
getObject(Enum) except allows dynamically obtaining
the dependencies. |
Object |
getProcessLock()
|
W |
getWork()
|
void |
join(FlowFuture flowFuture,
long timeout,
Object token)
Stops this
Task from proceeding to the next Task in its
JobSequence until the JobSequence of the input
FlowFuture is complete. |
void |
setComplete(boolean isComplete)
Indicates whether the
Task has completed. |
Object getProcessLock()
Obtains the lock for the ProcessState
containing the
ThreadState
executing the Task
.
This enables different ThreadState
instances of a
ProcessState
to have critical sections.
ProcessState
lock.Object getObject(D key)
key
- Key identifying the dependency.Object getObject(int dependencyIndex)
Similar to getObject(Enum)
except allows dynamically obtaining
the dependencies.
In other words, an Enum
is not required to define the possible
dependencies available.
dependencyIndex
- Index identifying the dependency.FlowFuture doFlow(F key, Object parameter)
Instigates a JobSequence
to be run.
The returned FlowFuture
may not complete while the current
Task
is executing. However it is available to register for later
checking by other Task
instances.
key
- Key identifying the JobSequence
to instigate.parameter
- Parameter for the first Task
of the
JobSequence
instigated.FlowFuture
to indicate when the instigated
JobSequence
has completed.FlowFuture doFlow(int flowIndex, Object parameter)
Similar to doFlow(Enum, Object)
except that allows dynamic
instigation of flows.
In other words, an Enum
is not required to define the possible
JobSequence
instances available.
flowIndex
- Index identifying the JobSequence
to instigate.parameter
- Parameter that will be available for the first Task
of
the JobSequence
to be run.FlowFuture
to indicate when the instigated
JobSequence
has completed.void doFlow(String workName, String taskName, Object parameter) throws UnknownWorkException, UnknownTaskException, InvalidParameterTypeException
Invokes a JobSequence
by dynamically naming the initial
Task
of the JobSequence
.
This method should not be preferred, as the other
doFlow(...)
methods are compile safe. This method however
provides the similar functionality as per reflection - powerful yet
compile unsafe.
The Work
and Task
reflective meta-data may be obtained
from the Office
made available via the
OfficeAwareWorkFactory
.
This method does not return a FlowFuture
as all invocations are
instigated in FlowInstigationStrategyEnum.PARALLEL
.
workName
- Name of Work
containing the Task
.taskName
- Name of Task
within the Work
.parameter
- Parameter to the task. May be null
.UnknownWorkException
- Should no Work
be known by the name.UnknownTaskException
- Should no Task
by the name be contained under the
Work
.InvalidParameterTypeException
- Should the parameter be an invalid type for the Task
.OfficeAwareWorkFactory
void join(FlowFuture flowFuture, long timeout, Object token) throws IllegalArgumentException
Stops this Task
from proceeding to the next Task
in its
JobSequence
until the JobSequence
of the input
FlowFuture
is complete.
Should the same JobSequence
be joined on twice, only the first
join is registered - second join of same JobSequence
will be
ignored.
flowFuture
- FlowFuture
of the JobSequence
that must
complete.timeout
- The maximum time to wait in milliseconds for the
JobSequence
to complete. Should the
JobSequence
not complete in this timeout, a
FlowJoinTimedOutEscalation
is escalated from this
Task
.token
- Should a FlowJoinTimedOutEscalation
be escalated the
token will be added to the escalated
FlowJoinTimedOutEscalation
to aid in identifying which
JobSequence
join timed out. May be null
.IllegalStateException
- If a ProcessState
or unknown FlowFuture
. Only
FlowFuture
instances returned from the
doFlow
methods are valid input.IllegalArgumentException
void setComplete(boolean isComplete)
Indicates whether the Task
has completed. Setting this to
false
has the Task.doTask(TaskContext)
method
invoked again after the Task
has returned control.
By default on invoking Task.doTask(TaskContext)
this is set to
true
. Therefore only use if the Task
has not yet
complete.
isComplete
- false
will have the
Task.doTask(TaskContext)
invoked again.Copyright © 2005–2016. All rights reserved.