|
Brooklyn | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrooklyn.event.basic.DependentConfiguration
public class DependentConfiguration
Conveniences for making tasks which run in entity ExecutionContexts, subscribing to attributes from other entities, possibly transforming those; these Task instances are typically passed in AbstractEntity#setConfig(ConfigKey, Object)#setConfig(ConfigKey, Object).
If using a lot it may be useful to:
import static brooklyn.event.basic.DependentConfiguration.*;
Field Summary | |
---|---|
protected static Logger |
LOG
|
Method Summary | |
---|---|
static Task
|
attributePostProcessedWhenReady(Entity source, AttributeSensor sensor, groovy.lang.Closure ready, groovy.lang.Closure postProcess)
|
static Task
|
attributePostProcessedWhenReady(Entity source, AttributeSensor sensor, groovy.lang.Closure postProcess)
|
static Task
|
attributePostProcessedWhenReady(Entity source, AttributeSensor sensor, Predicate ready, groovy.lang.Closure postProcess)
|
static Task
|
attributePostProcessedWhenReady(Entity source, AttributeSensor sensor, Predicate ready, Function postProcess)
|
static Task
|
attributeWhenReady(Entity source, AttributeSensor sensor)
@see #attributeWhenReady(Entity, AttributeSensor, Predicate); default readiness (if no third argument) is Groovy truth |
static Task
|
attributeWhenReady(Entity source, AttributeSensor sensor, groovy.lang.Closure ready)
|
static Task
|
attributeWhenReady(Entity source, AttributeSensor sensor, Predicate ready)
returns a Task which blocks until the given sensor on the given source entity gives a value that satisfies ready, then returns that value; particular useful in Entity configuration where config will block until Tasks have a value |
static Task
|
formatString(java.lang.String spec, java.lang.Object... args)
Method which returns a Future containing a string formatted using String.format, where the arguments can be normal objects or tasks; tasks will be waited on (submitted if necessary) and their results substituted in the call to String.format. |
static Task
|
listAttributesWhenReady(AttributeSensor sensor, java.lang.Iterable entities)
returns a task for parallel execution returning a list of values for the given sensor for the given entity list, optionally when the values satisfy a given readiness predicate (defaulting to groovy truth if not supplied) |
static Task
|
listAttributesWhenReady(AttributeSensor sensor, java.lang.Iterable entities, groovy.lang.Closure readiness)
|
static Task
|
listAttributesWhenReady(AttributeSensor sensor, java.lang.Iterable entities, Predicate readiness)
returns a task for parallel execution returning a list of values of the given sensor list on the given entity, optionally when the values satisfy a given readiness predicate (defaulting to groovy truth if not supplied) |
static Task
|
transform(Task task, Function transformer)
Returns a Task which waits for the result of first parameter, then applies the function in the second parameter to it, returning that result. |
static Task
|
transform(Task task, groovy.lang.Closure transformer)
@see #transform(Task, Function) |
static Task
|
transformMultiple(Function transformer, Task... tasks)
Returns a task which waits for multiple other tasks (submitting if necessary) and performs arbitrary computation over the List of results. |
static Task
|
transformMultiple(groovy.lang.Closure transformer, Task... tasks)
Returns a task which waits for multiple other tasks (submitting if necessary) and performs arbitrary computation over the List of results. |
static Task
|
valueWhenAttributeReady(Entity source, AttributeSensor sensor, java.lang.Object value)
|
static Task
|
valueWhenAttributeReady(Entity source, AttributeSensor sensor, Function valueProvider)
|
static Task
|
valueWhenAttributeReady(Entity source, AttributeSensor sensor, groovy.lang.Closure valueProvider)
|
static java.lang.Object
|
waitForTask(Task t, Entity context)
@see #waitForTask(Task, Entity, String) |
static java.lang.Object
|
waitForTask(Task t, Entity context, java.lang.String contextMessage)
blocks until the given task completes, submitting if necessary, returning the result of that task; optional contextMessage is available in status if this is running in a task |
static java.lang.Object
|
waitInTaskForAttributeReady(Entity source, AttributeSensor sensor, Predicate ready)
|
static Task
|
whenDone(java.util.concurrent.Callable job)
Returns a Task which blocks until the given job returns, then returns the value of that job. |
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 |
---|
protected static final Logger LOG
Method Detail |
---|
public static Task attributePostProcessedWhenReady(Entity source, AttributeSensor sensor, groovy.lang.Closure ready, groovy.lang.Closure postProcess)
public static Task attributePostProcessedWhenReady(Entity source, AttributeSensor sensor, groovy.lang.Closure postProcess)
public static Task attributePostProcessedWhenReady(Entity source, AttributeSensor sensor, Predicate ready, groovy.lang.Closure postProcess)
public static Task attributePostProcessedWhenReady(Entity source, AttributeSensor sensor, Predicate ready, Function postProcess)
public static Task attributeWhenReady(Entity source, AttributeSensor sensor)
public static Task attributeWhenReady(Entity source, AttributeSensor sensor, groovy.lang.Closure ready)
public static Task attributeWhenReady(Entity source, AttributeSensor sensor, Predicate ready)
public static Task formatString(java.lang.String spec, java.lang.Object... args)
Example:
setConfig(URL, DependentConfiguration.formatString("%s:%s",
DependentConfiguration.attributeWhenReady(target, Target.HOSTNAME),
DependentConfiguration.attributeWhenReady(target, Target.PORT) ) );
public static Task listAttributesWhenReady(AttributeSensor sensor, java.lang.Iterable entities)
public static Task listAttributesWhenReady(AttributeSensor sensor, java.lang.Iterable entities, groovy.lang.Closure readiness)
public static Task listAttributesWhenReady(AttributeSensor sensor, java.lang.Iterable entities, Predicate readiness)
public static Task transform(Task task, Function transformer)
public static Task transform(Task task, groovy.lang.Closure transformer)
public static Task transformMultiple(Function transformer, Task... tasks)
public static Task transformMultiple(groovy.lang.Closure transformer, Task... tasks)
public static Task valueWhenAttributeReady(Entity source, AttributeSensor sensor, java.lang.Object value)
public static Task valueWhenAttributeReady(Entity source, AttributeSensor sensor, Function valueProvider)
public static Task valueWhenAttributeReady(Entity source, AttributeSensor sensor, groovy.lang.Closure valueProvider)
public static java.lang.Object waitForTask(Task t, Entity context)
public static java.lang.Object waitForTask(Task t, Entity context, java.lang.String contextMessage)
public static java.lang.Object waitInTaskForAttributeReady(Entity source, AttributeSensor sensor, Predicate ready)
public static Task whenDone(java.util.concurrent.Callable job)
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.