Groovy Documentation

org.linkedin.glu.agent.impl.script
[Groovy] Class ScriptNode

java.lang.Object
  org.linkedin.glu.agent.impl.script.ScriptNode

class ScriptNode

A script node (recursive structure)

Authors:
ypujante@linkedin.com


Constructor Summary
ScriptNode(AgentContext agentContext, ScriptDefinition scriptDefinition, StateMachine stateMachine, java.lang.Object script, Logger log)

 
Method Summary
java.lang.Object addChild(MountPoint childMountPoint, java.lang.Object childInitParameters, java.lang.Object childScript, java.lang.Object closure)

boolean cancelTimer(java.lang.Object args)

@return false if the execution could not be cancelled, typically because it has already completed normally; true otherwise

java.lang.Object checkValidTransitionForAction(java.lang.Object action)

Checks if this is a valid transition at this moment in time.

void clearError()

FutureExecution executeAction(java.lang.Object args)

@param args.action

FutureExecution executeCall(java.lang.Object args)

Executes the call.

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

java.util.Collection getChildren()

java.util.Collection getChildrenMountPoints()

java.lang.Object getFullState()

Logger getLog()

MountPoint getMountPoint()

java.lang.String getName()

java.util.Map getParams()

GluScript getParent()

MountPoint getParentMountPoint()

java.lang.Object getScript()

java.lang.Object getScriptDefinition()

ScriptExecution getScriptExecution()

java.lang.Object getScriptState()

Shell getShell()

java.lang.Object getState()

StateManager getStateManager()

Timers getTimers()

boolean interruptAction(java.lang.Object args)

@param args.action the name of the action to interrupt

boolean interruptCurrentExecution()

@return false if the execution could not be cancelled, typically because it has already completed normally; true otherwise

java.lang.Object methodMissing(java.lang.String name, java.lang.Object args)

java.lang.Object propertyMissing(java.lang.String name)

java.lang.Object removeChild(ScriptNode child)

FutureExecution scheduleTimer(java.lang.Object args)

Schedule a timer.

void shutdown()

void start()

java.lang.String toString()

java.lang.Object waitForAction(java.lang.Object args)

Waits for the action (previously scheduled in executeAction(Object)) to complete no longer than the timeout provided.

void waitForShutdown()

void waitForShutdown(java.lang.Object timeout)

java.lang.Object waitForState(java.lang.Object state, java.lang.Object timeout)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

ScriptNode

ScriptNode(AgentContext agentContext, ScriptDefinition scriptDefinition, StateMachine stateMachine, java.lang.Object script, Logger log)


 
Method Detail

addChild

java.lang.Object addChild(MountPoint childMountPoint, java.lang.Object childInitParameters, java.lang.Object childScript, java.lang.Object closure)


cancelTimer

boolean cancelTimer(java.lang.Object args)
Returns:
false if the execution could not be cancelled, typically because it has already completed normally; true otherwise


checkValidTransitionForAction

java.lang.Object checkValidTransitionForAction(java.lang.Object action)
Checks if this is a valid transition at this moment in time.
throws:
ScriptIllegalStateException if it is not possible to execute the action because the state does not allow it


clearError

void clearError()


executeAction

FutureExecution executeAction(java.lang.Object args)
Parameters:
args.action
args.actionArgs
Returns:
a future execution (asynchronous execution, cancellable...)


executeCall

FutureExecution executeCall(java.lang.Object args)
Executes the call. Note that this method is *not* a blocking call
Parameters:
args.call - the call you want to execute
args.callArgs - the arguments to provide the call
Returns:
a future execution (asynchronous execution, cancellable...)


forceChangeState

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


getChildren

@Override
java.util.Collection getChildren()


getChildrenMountPoints

java.util.Collection getChildrenMountPoints()


getFullState

java.lang.Object getFullState()


getLog

Logger getLog()


getMountPoint

MountPoint getMountPoint()


getName

java.lang.String getName()


getParams

@Override
java.util.Map getParams()


getParent

@Override
GluScript getParent()


getParentMountPoint

MountPoint getParentMountPoint()


getScript

java.lang.Object getScript()


getScriptDefinition

java.lang.Object getScriptDefinition()


getScriptExecution

ScriptExecution getScriptExecution()


getScriptState

java.lang.Object getScriptState()


getShell

@Override
Shell getShell()


getState

java.lang.Object getState()


getStateManager

@Override
StateManager getStateManager()


getTimers

@Override
Timers getTimers()


interruptAction

boolean interruptAction(java.lang.Object args)
Parameters:
args.action - the name of the action to interrupt
args.actionId - the id of the action to interrupt (only one of each)
Returns:
false if the action could not be cancelled, typically because it has already completed normally; true otherwise


interruptCurrentExecution

boolean interruptCurrentExecution()
Returns:
false if the execution could not be cancelled, typically because it has already completed normally; true otherwise


methodMissing

java.lang.Object methodMissing(java.lang.String name, java.lang.Object args)


propertyMissing

java.lang.Object propertyMissing(java.lang.String name)


removeChild

java.lang.Object removeChild(ScriptNode child)


scheduleTimer

FutureExecution scheduleTimer(java.lang.Object args)
Schedule a timer.
Parameters:
args.timer - there can only be one timer with a given name
args.initialFrequency - how long to wait the first time (optional)
args.repeatFrequency - how long to wait after the first time
Returns:
a future execution (asynchronous execution, cancellable...)


shutdown

void shutdown()


start

@Override
void start()


toString

java.lang.String toString()


waitForAction

java.lang.Object waitForAction(java.lang.Object args)
Waits for the action (previously scheduled in executeAction(Object)) to complete no longer than the timeout provided. Note that due to the nature of the call it is possible that this method throws a NoSuchActionException in some cases:
throws:
org.linkedin.glu.agent.api.NoSuchActionException if the action cannot be found
throws:
TimeoutException if the action cannot be completed in the given amount of time
Parameters:
args.action - the name of the action to wait for
args.actionId - the id of the action to wait for (only one of each)
args.timeout - if not null, the amount of time to wait maximum
Returns:
the value of the execution


waitForShutdown

void waitForShutdown()


waitForShutdown

void waitForShutdown(java.lang.Object timeout)


waitForState

java.lang.Object waitForState(java.lang.Object state, java.lang.Object timeout)


 

Groovy Documentation