|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.common.core.utils.handlers.lifetime.State
public abstract class State
Partial implementation for models of distinguished states in the lifetime of a 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;
| Nested Class Summary | |
|---|---|
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. |
| Constructor Summary | |
|---|---|
protected |
State()
Creates a new instance. |
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected State()
| Method Detail |
|---|
protected abstract void addPrevious(List<State> previous)
previous - the previous states.public final List<State> getPrevious()
public String toString()
toString in class Object
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.
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||