Package org.gcube.smartgears.lifecycle
Class DefaultLifecycle<S extends State<S>>
- java.lang.Object
-
- org.gcube.smartgears.lifecycle.DefaultLifecycle<S>
-
- All Implemented Interfaces:
Lifecycle<S>
- Direct Known Subclasses:
ApplicationLifecycle,ContainerLifecycle
public class DefaultLifecycle<S extends State<S>> extends Object implements Lifecycle<S>
-
-
Constructor Summary
Constructors Constructor Description DefaultLifecycle(org.gcube.common.events.Hub hub, String name, S startState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidmoveTo(S next)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 next)Attempts to transition this lifecycle to a given state, but does not fail if the transition is illegal for this lifecycle.
-
-
-
Method Detail
-
state
public S state()
Description copied from interface:LifecycleReturns the current state of this lifecycle.
-
moveTo
public void moveTo(S next)
Description copied from interface:LifecycleTransition this lifecycle to a given state.
-
tryMoveTo
public boolean tryMoveTo(S next)
Description copied from interface:LifecycleAttempts to transition this lifecycle to a given state, but does not fail if the transition is illegal for this lifecycle.
-
-