public abstract class State extends Object
GCUBEIHandler.
A subclass that models a given state:
State with a list of other states from which a handler may transition to the state;toString() to facilitate the management of the state;getLifetimeEvent() to produce a Event.LifetimeEvent associated with a handler's transition to the state.null.onEnter() and onExit() to specify behaviour to be executed immediately after a handler
moves into the state and immediately before a handler leaves the state;| Modifier and Type | Class and Description |
|---|---|
static class |
State.Created
Specialises
State for the (private) start state of a handler. |
static class |
State.Done
Specialises
State for the state of a handler that has completed execution. |
static class |
State.Failed
Specialises
State for the state of a handler that has failed prior or during its execution. |
static class |
State.Running
Specialises
State for the state of a handler that is executing. |
static class |
State.Suspended
Specialises
State for the state of a handler that has suspended its execution. |
| Modifier | Constructor and Description |
|---|---|
protected |
State()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addPrevious(List<State> previous)
Adds the states from which a handler may transition to this state.
|
boolean |
equals(Object o) |
Event.LifetimeEvent |
getLifetimeEvent()
Returns a
Event.LifetimeEvent for the transition to this state. |
List<State> |
getPrevious()
Returns the states from which a handler may transition to this state.
|
int |
hashCode() |
void |
onEnter()
Invoked by upon transitioning to this state.
|
void |
onExit()
Invoked upon transitioning from this state.
|
String |
toString() |
protected abstract void addPrevious(List<State> previous)
previous - the previous states.public final List<State> getPrevious()
public void onEnter()
throws Exception
Exception - if the transition could not occur.public void onExit()
throws Exception
Exception - if the transition could not occur.public Event.LifetimeEvent getLifetimeEvent()
Event.LifetimeEvent for the transition to this state.
Return null if the transition should not be notified.
Copyright © 2015. All Rights Reserved.