public abstract class BrooklynDslDeferredSupplier<T> extends java.lang.Object implements DeferredSupplier<T>, ImmediateSupplier<T>, TaskFactory<Task<T>>, java.io.Serializable
DeferredSupplierso that they can be resolved when needed (e.g. when entity-lookup and execution contexts are available).
Implementations of this abstract class are expected to be immutable and thread safe,
as instances must support usage in multiple
created from a single
AssemblyTemplate. The object can be used in parallel
from multiple threads and no locking is done as all extending objects are assumed to be stateless.
Subclasses which return a deferred value are typically only
resolvable in the context of a
Task on an
these should be only used as the value of a
ConfigKey set in the YAML,
and should not accessed until after the components / entities are created
and are being started.
(TODO the precise semantics of this are under development.)
The threading model is that only one thread can call
get() at a time. An interruptible
lock is obtained using
#lock for the duration of that method. It is important to not
synchronized because that is not interruptible - if someone tries to get the value
and interrupts after a short wait, then we must release the lock immediately and return.
|Constructor and Description|
|Modifier and Type||Method and Description|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait