Groovy Documentation

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

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

class ScriptExecution

Authors:
ypujante@linkedin.com


Property Summary
Clock clock

Timespan expiryDuration

int expiryMaxElements

Timespan heartbeat

 
Constructor Summary
ScriptExecution(java.lang.Object source, java.lang.String name, Logger log)

 
Method Summary
boolean cancel(java.lang.String id, boolean mayInterruptIfRunning)

Convenient call to future using its unique id

boolean cancelTimer(java.lang.String timer, boolean mayInterruptIfRunning)

Cancels a timer by name

FutureExecution executeAction(java.lang.String action, java.lang.Object actionArgs, groovy.lang.Closure onCompletionCallback = null, groovy.lang.Closure onCancelPreCallback = null, groovy.lang.Closure onCancelPostCallback = null)

Executes the action for the given script.

FutureExecution executeCall(java.lang.String call, java.lang.Object callArgs, groovy.lang.Closure cancelCallback)

Executes the call for the given script.

FutureExecution findFuture(java.lang.String id)

Returns:
the future by unique id.

FutureExecution findFutureActionById(java.lang.String id)

By id (only actions)

FutureExecution findFutureActionByName(java.lang.String action)

By name

java.lang.Object get(java.lang.String id)

Convenient call to future using its unique id

java.lang.Object get(java.lang.String id, java.lang.Object timeout)

Convenient call to future using its unique id

java.lang.Object get(java.lang.String id, long timeout, java.util.concurrent.TimeUnit unit)

Convenient call to future using its unique id

FutureExecution getCurrent()

@return currently running execution

java.lang.Object getLock()

mostly for use from test only...

java.lang.Object getPastExecutions()

java.lang.Object getTimeline()

java.lang.Object getTimers()

@return the timers that have been set

boolean isCancelled(java.lang.String id)

Convenient call to future using its unique id

boolean isDone(java.lang.String id)

Convenient call to future using its unique id

FutureExecution scheduleTimer(java.lang.String timer, java.lang.Object initialFrequency, java.lang.Object repeatFrequency, groovy.lang.Closure cancelCallback)

Schedule a timer.

void shutdown()

void start()

void waitForShutdown()

void waitForShutdown(java.lang.Object timeout)

void waitForShutdownInvocation()

waitForShutdown waits for shutdown to be complete.

 
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()
 

Property Detail

clock

Clock clock


expiryDuration

Timespan expiryDuration


expiryMaxElements

int expiryMaxElements


heartbeat

Timespan heartbeat


 
Constructor Detail

ScriptExecution

ScriptExecution(java.lang.Object source, java.lang.String name, Logger log)


 
Method Detail

cancel

boolean cancel(java.lang.String id, boolean mayInterruptIfRunning)
Convenient call to future using its unique id


cancelTimer

boolean cancelTimer(java.lang.String timer, boolean mayInterruptIfRunning)
Cancels a timer by name


executeAction

FutureExecution executeAction(java.lang.String action, java.lang.Object actionArgs, groovy.lang.Closure onCompletionCallback = null, groovy.lang.Closure onCancelPreCallback = null, groovy.lang.Closure onCancelPostCallback = null)
Executes the action for the given script. The id can be used to to make future calls without having a reference to the future itself.
Returns:
a future execution


executeCall

FutureExecution executeCall(java.lang.String call, java.lang.Object callArgs, groovy.lang.Closure cancelCallback)
Executes the call for the given script. The id can be used to to make future calls without having a reference to the future itself.
Returns:
a future execution


findFuture

FutureExecution findFuture(java.lang.String id)
Returns:
the future by unique id. Note that if the future has completed more than expiryDuration ago, then there is no guarantee that the future will still be returned.


findFutureActionById

FutureExecution findFutureActionById(java.lang.String id)
By id (only actions)


findFutureActionByName

FutureExecution findFutureActionByName(java.lang.String action)
By name


get

java.lang.Object get(java.lang.String id)
Convenient call to future using its unique id


get

java.lang.Object get(java.lang.String id, java.lang.Object timeout)
Convenient call to future using its unique id


get

java.lang.Object get(java.lang.String id, long timeout, java.util.concurrent.TimeUnit unit)
Convenient call to future using its unique id


getCurrent

FutureExecution getCurrent()
Returns:
currently running execution


getLock

java.lang.Object getLock()
mostly for use from test only...


getPastExecutions

java.lang.Object getPastExecutions()


getTimeline

java.lang.Object getTimeline()


getTimers

java.lang.Object getTimers()
Returns:
the timers that have been set


isCancelled

boolean isCancelled(java.lang.String id)
Convenient call to future using its unique id


isDone

boolean isDone(java.lang.String id)
Convenient call to future using its unique id


scheduleTimer

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


shutdown

void shutdown()


start

void start()


waitForShutdown

void waitForShutdown()


waitForShutdown

void waitForShutdown(java.lang.Object timeout)


waitForShutdownInvocation

void waitForShutdownInvocation()
waitForShutdown waits for shutdown to be complete. On the other end, this call waits for shutdown to be called.


 

Groovy Documentation