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
 void moveTo(S state)
          Transition this lifecycle to a given state.
 S previous()
          Returns the state from which this lifecycle transitioned to its current state.
 S state()
          Returns the current state of this lifecycle.
 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.
 

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:
true if this lifecycle has transitioned to the given state


Copyright © 2013. All Rights Reserved.