Groovy Documentation

org.linkedin.glu.agent.api
[Groovy] Interface StateManager


interface StateManager

This interface is available from any GLU script using stateManager property Each script is backed by a state machine (org.linkedin.glu.util.state.StateMachine).

Authors:
ypujante@linkedin.com


Method Summary
void forceChangeState(java.lang.Object currentState, java.lang.Object error)

This method is used to change the state and should be used carefully.

java.lang.Object getFullState()

@return a map with the following definition:

 [
   scriptDefinition: [ mountPoint: x,
                       parent: x,
                       scriptFactory: x,
                       initParameters: x ], // all values provided when installing the glu script
    scriptState: [
                   script: [x:x], // all serializable variables in the glu script
                   stateMachine: getState(),
                   timers: [[timer: x, repeatFrequency: x], ...]
                 ]
 ]
 

java.lang.Object getState()

@return the state of the script (from a state machine point of view) (see info org.linkedin.glu.util.state.StateMachine#getState())

 

Method Detail

forceChangeState

void forceChangeState(java.lang.Object currentState, java.lang.Object error)
This method is used to change the state and should be used carefully. This method cannot be used when in transition state
Parameters:
currentState - the new current state (can be null in which case we keep the current one)
error - the new error state


getFullState

java.lang.Object getFullState()
Returns:
a map with the following definition:
 [
   scriptDefinition: [ mountPoint: x,
                       parent: x,
                       scriptFactory: x,
                       initParameters: x ], // all values provided when installing the glu script
    scriptState: [
                   script: [x:x], // all serializable variables in the glu script
                   stateMachine: getState(),
                   timers: [[timer: x, repeatFrequency: x], ...]
                 ]
 ]
 


getState

java.lang.Object getState()
Returns:
the state of the script (from a state machine point of view) (see info org.linkedin.glu.util.state.StateMachine#getState())


 

Groovy Documentation