Package org.gcube.smartgears.lifecycle
Interface Lifecycle<S extends State<S>>
-
- All Known Implementing Classes:
ApplicationLifecycle,ContainerLifecycle,DefaultLifecycle
public interface Lifecycle<S extends State<S>>The lifecycle of an application managed as a gCube service.- Author:
- Fabio Simeoni
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidmoveTo(S state)Transition this lifecycle to a given state.Sprevious()Returns the state from which this lifecycle transitioned to its current state.Sstate()Returns the current state of this lifecycle.booleantryMoveTo(S state)Attempts to transition this lifecycle to a given state, but does not fail if the transition is illegal for this lifecycle.
-
-
-
Method Detail
-
previous
S previous()
Returns the state from which this lifecycle transitioned to its current state.- Returns:
- the previous state
-
state
S state()
Returns the current state of this lifecycle.- Returns:
- the current state.
-
moveTo
void moveTo(S state)
Transition this lifecycle to a given state.- Parameters:
state- the state- Throws:
IllegalStateException- if the transition is illegal for this lifecycle
-
tryMoveTo
boolean tryMoveTo(S state)
Attempts to transition this lifecycle to a given state, but does not fail if the transition is illegal for this lifecycle.- Parameters:
state- the state- Returns:
trueif this lifecycle has transitioned to the given state
-
-