|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.util.task.Tasks
public class Tasks
Method Summary | |
---|---|
static Task
|
current()
the Task where the current thread is executing, if executing in a Task, otherwise null |
static java.lang.Object
|
resolveValue(java.lang.Object v, java.lang.Class type, ExecutionContext exec)
@see #resolveValue(Object, Class, ExecutionContext, String) |
static java.lang.Object
|
resolveValue(java.lang.Object v, java.lang.Class type, ExecutionContext exec, java.lang.String contextMessage)
attempt to resolve the given value as the given type, waiting on futures, submitting if necessary, and coercing as allowed by TypeCoercions; contextMessage (optional) will be displayed in status reports while it waits (e.g. the name of the config key being looked up) |
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 |
static void
|
setExtraStatusDetails(java.lang.String notes)
sets extra status details on the current task, if possible (otherwise does nothing). |
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
|
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 |
---|
@SuppressWarnings("rawtypes") public static Task current()
public static java.lang.Object resolveValue(java.lang.Object v, java.lang.Class type, ExecutionContext exec)
@SuppressWarnings({ "unchecked", "rawtypes" }) public static java.lang.Object resolveValue(java.lang.Object v, java.lang.Class type, ExecutionContext exec, java.lang.String contextMessage)
public static void setBlockingDetails(java.lang.String description)
public static void setExtraStatusDetails(java.lang.String notes)
@SuppressWarnings("rawtypes") public static java.lang.Object withBlockingDetails(java.lang.String description, java.util.concurrent.Callable code)
withBlockingDetails("sleeping 5s") { Thread.sleep(5000); }
.
if code block is null, the description is set until further notice (not cleareed).
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.