@ThreadSafe public class TaskStateMachine extends Object
Constructor and Description |
---|
TaskStateMachine(TaskId taskId,
Executor executor) |
Modifier and Type | Method and Description |
---|---|
void |
abort() |
void |
addStateChangeListener(StateMachine.StateChangeListener<TaskState> stateChangeListener)
Listener is always notified asynchronously using a dedicated notification thread pool so, care should
be taken to avoid leaking
this when adding a listener in a constructor. |
void |
cancel() |
void |
failed(Throwable cause) |
void |
finished() |
org.joda.time.DateTime |
getCreatedTime() |
LinkedBlockingQueue<Throwable> |
getFailureCauses() |
TaskState |
getState() |
com.google.common.util.concurrent.ListenableFuture<TaskState> |
getStateChange(TaskState currentState) |
TaskId |
getTaskId() |
String |
toString() |
public org.joda.time.DateTime getCreatedTime()
public TaskId getTaskId()
public TaskState getState()
public com.google.common.util.concurrent.ListenableFuture<TaskState> getStateChange(TaskState currentState)
public LinkedBlockingQueue<Throwable> getFailureCauses()
public void finished()
public void cancel()
public void abort()
public void failed(Throwable cause)
public void addStateChangeListener(StateMachine.StateChangeListener<TaskState> stateChangeListener)
this
when adding a listener in a constructor. Additionally, it is
possible notifications are observed out of order due to the asynchronous execution.Copyright © 2012–2022. All rights reserved.