|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.util.task.BasicExecutionManager
public class BasicExecutionManager
TODO javadoc
Method Summary | |
---|---|
java.lang.Object
|
BasicExecutionManager(java.lang.String contextid)
|
void
|
addListener(ExecutionListener listener)
|
protected void
|
afterEnd(java.util.Map flags, Task task)
|
protected void
|
beforeStart(java.util.Map flags, Task task)
|
protected void
|
beforeSubmit(java.util.Map flags, Task task)
|
boolean
|
clearTaskPreprocessorForTag(java.lang.Object tag)
|
boolean
|
clearTaskSchedulerForTag(java.lang.Object tag)
|
void
|
deleteTag(java.lang.Object tag)
|
void
|
deleteTask(Task task)
|
static Task
|
getCurrentTask()
@deprecated in 0.4.0, use Tasks.current() |
long
|
getNumActiveTasks()
|
long
|
getNumInMemoryTasks()
|
long
|
getNumIncompleteTasks()
|
static java.lang.ThreadLocal
|
getPerThreadCurrentTask()
|
Task
|
getTask(java.lang.String id)
|
TaskPreprocessor
|
getTaskPreprocessorForTag(java.lang.Object tag)
Returns TaskPreprocessor defined for tasks with the given tag, or null if none. |
TaskScheduler
|
getTaskSchedulerForTag(java.lang.Object tag)
Forgets that any preprocessor was associated with a tag. |
java.util.Set
|
getTaskTags()
|
java.util.Set
|
getTasksWithAllTags(java.lang.Iterable tags)
|
java.util.Set
|
getTasksWithAnyTag(java.lang.Iterable tags)
|
java.util.Set
|
getTasksWithTag(java.lang.Object tag)
|
long
|
getTotalTasksSubmitted()
|
boolean
|
isShutdown()
|
protected java.util.concurrent.ThreadFactory
|
newThreadFactory(java.lang.String contextid)
For use by overriders to use custom thread factory. |
void
|
removeListener(ExecutionListener listener)
|
Task
|
scheduleWith(Task task)
|
Task
|
scheduleWith(java.util.Map flags, Task task)
|
static void
|
setBlockingDetails(java.lang.String description)
convenience for setting "blocking details" on any task where the current thread is running; typically invoked prior to a wait, for transparency to a user; then invoked with 'null' just after the wait |
void
|
setTaskPreprocessorForTag(java.lang.Object tag, java.lang.Class preprocessor)
|
void
|
setTaskPreprocessorForTag(java.lang.Object tag, TaskPreprocessor preprocessor)
Defines a TaskPreprocessor to run on all subsequently submitted jobs with the given tag. |
void
|
setTaskSchedulerForTag(java.lang.Object tag, java.lang.Class scheduler)
|
void
|
setTaskSchedulerForTag(java.lang.Object tag, TaskScheduler scheduler)
Defines a TaskScheduler to run on all subsequently submitted jobs with the given tag. |
void
|
shutdownNow()
|
Task
|
submit(java.lang.Runnable r)
|
Task
|
submit(java.util.Map flags, java.lang.Runnable r)
|
Task
|
submit(java.util.concurrent.Callable c)
|
Task
|
submit(java.util.Map flags, java.util.concurrent.Callable c)
|
Task
|
submit(Task t)
|
Task
|
submit(java.util.Map flags, Task task)
|
Task
|
submit(java.util.Map flags, java.lang.Object c)
|
protected Task
|
submitNewScheduledTask(java.util.Map flags, ScheduledTask task)
|
protected Task
|
submitNewTask(java.util.Map flags, Task task)
|
static java.lang.Object
|
withBlockingDetails(java.lang.String description, java.util.concurrent.Callable code)
convenience for setting "blocking details" on any task where the current thread is running, while the passed code is executed; often used from groovy as withBlockingDetails("sleeping 5s") { Thread.sleep(5000); } |
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() |
Method Detail |
---|
public java.lang.Object BasicExecutionManager(java.lang.String contextid)
public void addListener(ExecutionListener listener)
} protected void afterEnd(java.util.Map flags, Task task)
} protected void beforeStart(java.util.Map flags, Task task)
for (Object tag: ((BasicTask)task).tags) { protected void beforeSubmit(java.util.Map flags, Task task)
public boolean clearTaskPreprocessorForTag(java.lang.Object tag)
public boolean clearTaskSchedulerForTag(java.lang.Object tag)
public void deleteTag(java.lang.Object tag)
public void deleteTask(Task task)
public static Task getCurrentTask()
public long getNumActiveTasks()
public long getNumInMemoryTasks()
public long getNumIncompleteTasks()
public static java.lang.ThreadLocal getPerThreadCurrentTask()
Setresult = getMutableTasksWithTag(tag); public Task getTask(java.lang.String id)
//might support multiple in future... public TaskPreprocessor getTaskPreprocessorForTag(java.lang.Object tag)
public TaskScheduler getTaskSchedulerForTag(java.lang.Object tag)
public java.util.Set getTaskTags()
Iterator ti = tags.iterator(); public java.util.Set getTasksWithAllTags(java.lang.Iterable tags)
return Collections.unmodifiableSet(result); public java.util.Set getTasksWithAnyTag(java.lang.Iterable tags)
public java.util.Set getTasksWithTag(java.lang.Object tag)
public long getTotalTasksSubmitted()
public boolean isShutdown()
protected java.util.concurrent.ThreadFactory newThreadFactory(java.lang.String contextid)
public void removeListener(ExecutionListener listener)
public Task scheduleWith(Task task)
public Task scheduleWith(java.util.Map flags, Task task)
public static void setBlockingDetails(java.lang.String description)
setTaskPreprocessorForTag(tag, preprocessor.newInstance()); public void setTaskPreprocessorForTag(java.lang.Object tag, java.lang.Class preprocessor)
public TaskScheduler getTaskSchedulerForTag(Object tag) { public void setTaskPreprocessorForTag(java.lang.Object tag, TaskPreprocessor preprocessor)
public void setTaskSchedulerForTag(java.lang.Object tag, java.lang.Class scheduler)
public void setTaskSchedulerForTag(java.lang.Object tag, TaskScheduler scheduler)
public void shutdownNow()
public Task submit(java.lang.Runnable r)
public Task submit(java.util.Map flags, java.lang.Runnable r)
public Task submit(java.util.concurrent.Callable c)
public Task submit(java.util.Map flags, java.util.concurrent.Callable c)
public Task submit(Task t)
public Task submit(java.util.Map flags, Task task)
public Task submit(java.util.Map flags, java.lang.Object c)
protected Task submitNewScheduledTask(java.util.Map flags, ScheduledTask task)
protected Task submitNewTask(java.util.Map flags, Task task)
public static java.lang.Object withBlockingDetails(java.lang.String description, java.util.concurrent.Callable code)
withBlockingDetails("sleeping 5s") { Thread.sleep(5000); }
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.