org.gcube.common.ghn.service.lifecycle
Interface Lifecycle

All Known Implementing Classes:
DefaultLifecycle

public interface Lifecycle

The lifecycle of an application managed as a gCube service.

Author:
Fabio Simeoni

Field Summary
static String failed
          The event qualifier that correspond to the failed state of the service lifecycle.
static String ready
          The event qualifier that correspond to the ready state of the service lifecycle.
static String started
          The event qualifier that correspond to the started state of the service lifecycle.
static String stopped
          The event qualifier that correspond to the stopped state of the service lifecycle.
 
Method Summary
 void moveTo(State state)
          Transition this lifecycle to a given state.
 State previous()
          Returns the state from which this lifecycle transitioned to its current state.
 State state()
          Returns the current state of this lifecycle.
 void tryMoveTo(State state)
          Attempts to transition this lifecycle to a given state, but does not fail if the transition is illegal for this lifecycle.
 

Field Detail

started

static final String started
The event qualifier that correspond to the started state of the service lifecycle.

See Also:
Constant Field Values

ready

static final String ready
The event qualifier that correspond to the ready state of the service lifecycle.

See Also:
Constant Field Values

stopped

static final String stopped
The event qualifier that correspond to the stopped state of the service lifecycle.

See Also:
Constant Field Values

failed

static final String failed
The event qualifier that correspond to the failed state of the service lifecycle.

See Also:
Constant Field Values
Method Detail

previous

State previous()
Returns the state from which this lifecycle transitioned to its current state.

Returns:
the previous state

state

State state()
Returns the current state of this lifecycle.

Returns:
the current state.

moveTo

void moveTo(State state)
Transition this lifecycle to a given state.

Parameters:
state - the state
Throws:
IllegalStateException - if the transition is illegal for this lifecycle

tryMoveTo

void tryMoveTo(State 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


Copyright © 2013. All Rights Reserved.