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, Luca Frosini (ISTI-CNR)
-
Method Summary
Modifier and TypeMethodDescriptionvoidTransition this lifecycle to a given state.previous()Returns the state from which this lifecycle transitioned to its current state.state()Returns the current state of this lifecycle.booleanAttempts to transition this lifecycle to a given state, but does not fail if the transition is illegal for this lifecycle.
-
Method Details
-
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
Transition this lifecycle to a given state.- Parameters:
state- the state- Throws:
IllegalStateException- if the transition is illegal for this lifecycle
-
tryMoveTo
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
-