|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectorg.linkedin.glu.groovy.utils.concurrent.FutureTaskExecution
class FutureTaskExecution
Field Summary | |
---|---|
static Submitter |
DEFAULT_SUBMITTER
|
protected java.util.concurrent.Callable |
_callable
The callable assigned in the constructor (if any) |
protected java.util.concurrent.FutureTask |
_future
The actual future task on which all the calls will be delegated to implement the
|
protected groovy.lang.Closure |
_onCompletionCallback
Callback to be called once the future ends |
protected boolean |
_onCompletionCallbackCalled
set when the completion callback has been called |
Property Summary | |
---|---|
Clock |
clock
The clock |
long |
completionTime
when the execution completes |
java.lang.String |
description
An (optional) description for the task |
long |
futureExecutionTime
when the execution should start (0 means start now) |
long |
startTime
when the execution started |
Constructor Summary | |
FutureTaskExecution()
In this case, the execute method will be called |
|
FutureTaskExecution(java.util.concurrent.Callable callable)
execute the callable |
|
FutureTaskExecution(groovy.lang.Closure closure)
execute the closure |
Method Summary | |
---|---|
boolean
|
cancel(boolean mayInterruptIfRunning)
|
protected T
|
execute()
|
T
|
get(java.lang.Object timeout)
|
T
|
get()
|
T
|
get(long timeout, java.util.concurrent.TimeUnit unit)
|
java.lang.String
|
getId()
|
groovy.lang.Closure
|
getOnCompletionCallback()
|
boolean
|
isCancelled()
|
boolean
|
isDone()
|
boolean
|
isStarted()
|
void
|
run()
|
FutureTaskExecution
|
runAsync(Submitter submitter = DEFAULT_SUBMITTER)
Runs asynchronously. |
T
|
runSync()
Runs synchronously. |
void
|
setId(java.lang.String id)
|
void
|
setOnCompletionCallback(groovy.lang.Closure onCompletionCallback)
This method ensures that the completion callback is called even if the command has already run and is completed! |
void
|
waitForStart(java.lang.Object timeout = null)
|
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() |
Field Detail |
---|
public static final Submitter DEFAULT_SUBMITTER
protected final java.util.concurrent.Callable _callable
protected final java.util.concurrent.FutureTask _future
Future
interface
protected groovy.lang.Closure _onCompletionCallback
protected boolean _onCompletionCallbackCalled
Property Detail |
---|
Clock clock
long completionTime
java.lang.String description
long futureExecutionTime
long startTime
Constructor Detail |
---|
FutureTaskExecution()
FutureTaskExecution(java.util.concurrent.Callable callable)
FutureTaskExecution(groovy.lang.Closure closure)
Method Detail |
---|
@Override boolean cancel(boolean mayInterruptIfRunning)
protected T execute()
T get(java.lang.Object timeout)
@Override T get()
@Override T get(long timeout, java.util.concurrent.TimeUnit unit)
@Override java.lang.String getId()
groovy.lang.Closure getOnCompletionCallback()
@Override boolean isCancelled()
@Override boolean isDone()
boolean isStarted()
void run()
FutureTaskExecution runAsync(Submitter submitter = DEFAULT_SUBMITTER)
this
for convenience
T runSync()
void setId(java.lang.String id)
void setOnCompletionCallback(groovy.lang.Closure onCompletionCallback)
void waitForStart(java.lang.Object timeout = null)
Groovy Documentation