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

      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