public interface Job
The interface provides the main job lifecycle control, taking on the following execution state values:
Current
- The current state of execution
when the job is not executing a state transition; the source state
while the job is making a state transition after the client code
calls stateChange(Job.Action)
.Next
- The destination state while the job
is making a state transition; same as the current
state while the job state is stable (that is, not making a transition).Modifier and Type | Interface and Description |
---|---|
static class |
Job.Action
Actions which trigger
Job.State transitions. |
static class |
Job.State
States of a graph job.
|
Modifier and Type | Method and Description |
---|---|
void |
complete()
Waits for any outstanding job work to complete.
|
void |
complete(long timeout,
java.util.concurrent.TimeUnit unit)
Waits for at most the specified time for the job to complete.
|
Job.State |
getCurrentState()
Retrieves the current state of this job.
|
java.lang.String |
getId()
Returns the identifier of this job.
|
java.lang.String |
getName()
Returns the name of this job.
|
Job.State |
getNextState()
Retrieves the next execution state when this job makes a state
transition.
|
void |
stateChange(Job.Action action)
Initiates a
State change. |
Job.State getCurrentState()
Job.State getNextState()
getCurrentState()
.void stateChange(Job.Action action) throws java.lang.IllegalArgumentException
State
change.action
- which triggers the state change.java.lang.IllegalArgumentException
- if the job is not in an appropriate
state for the requested action, or the action is not supported.java.lang.String getName()
java.lang.String getId()
void complete() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
- if the job execution threw an exception.java.lang.InterruptedException
- if the current thread was interrupted while waitingvoid complete(long timeout, java.util.concurrent.TimeUnit unit) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException, java.util.concurrent.TimeoutException
timeout
- the time to waitunit
- the time unit of the timeout argumentjava.util.concurrent.ExecutionException
- if the job execution threw an exception.java.lang.InterruptedException
- if the current thread was interrupted while waitingjava.util.concurrent.TimeoutException
- if the wait timed outCopyright IBM 2015,2016 - 2f6ad0e-20160307-0902