|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroovyx.gpars.serial.WithSerialId
gpars.dataflow.DataFlowExpression
@SuppressWarnings({"UnqualifiedStaticUsage", "CallToSimpleGetterFromWithinClass"}) class DataFlowExpression extends WithSerialId
The base class for all dataflow elements.
Nested Class Summary | |
---|---|
class |
DataFlowExpression.BindDataFlow
Represents a remote message binding a value to a remoted DataFlowExpression |
class |
DataFlowExpression.DataFlowExpressionsCollector
Listener for availability of data flow expressions we depend from |
class |
DataFlowExpression.TransformMany
|
class |
DataFlowExpression.TransformOne
|
class |
DataFlowExpression.WaitingThread
A logical representation of a synchronous or asynchronous request to read the value once it is bound. |
Field Summary | |
---|---|
protected static int |
S_INITIALIZED
|
protected static int |
S_INITIALIZING
|
protected static int |
S_NOT_INITIALIZED
Possible states |
protected int |
state
Holds the current state of the variable |
protected static AtomicIntegerFieldUpdater |
stateUpdater
Updater for the state field |
protected T |
value
Holds the actual value. |
protected static AtomicReferenceFieldUpdater |
waitingUpdater
Updater for the waiting field |
Constructor Summary | |
DataFlowExpression()
|
Method Summary | |
---|---|
protected def
|
DataFlowExpression()
Creates a new unbound Dataflow Expression |
void
|
bind(T value)
Assigns a value to the variable. |
void
|
bindSafely(T value)
Assigns a value to the variable. |
void
|
doBindRemote(UUID hostId, T message)
Binds the value after receiving a bing message over the wire |
protected T
|
evaluate()
Evaluate expression after the ones we depend on are ready |
MetaClass
|
getMetaClass()
|
Object
|
getProperty(String propertyName)
Returns either standard property of expression or creates expression, which will request given property when receiver became available |
T
|
getVal()
Reads the value of the variable. |
T
|
getVal(long timeout, TimeUnit units)
Reads the value of the variable. |
void
|
getValAsync(MessageStream callback)
Asynchronously retrieves the value of the variable. |
void
|
getValAsync(Object attachment, MessageStream callback)
Used by Dataflow operators. |
Object
|
invokeMethod(String name, Object args)
|
boolean
|
isBound()
Check if value has been set already for this expression |
void
|
rightShift(Closure closure)
Schedule closure to be executed by pooled actor after data became available It is important to notice that even if data already available the execution of closure will not happen immediately but will be scheduled |
void
|
setMetaClass(MetaClass metaClass)
|
void
|
setProperty(String propertyName, Object newValue)
|
protected void
|
subscribe()
Utility method to call at the very end of constructor of derived expressions. |
protected void
|
subscribe(DataFlowExpressionsCollector listener)
|
String
|
toString()
|
static DataFlowExpression
|
transform(Object another, Closure closure)
|
void
|
whenBound(Closure closure)
Schedule closure to be executed by pooled actor after data becomes available It is important to notice that even if data already available the execution of closure will not happen immediately but will be scheduled. |
void
|
whenBound(MessageStream stream)
Send the bound data to provided stream when it becomes available |
Field Detail |
---|
protected static final int S_INITIALIZED
protected static final int S_INITIALIZING
protected static final int S_NOT_INITIALIZED
protected int state
protected static final AtomicIntegerFieldUpdater stateUpdater
@SuppressWarnings({"InstanceVariableMayNotBeInitialized"}) protected T value
protected static final AtomicReferenceFieldUpdater waitingUpdater
Constructor Detail |
---|
DataFlowExpression()
Method Detail |
---|
protected def DataFlowExpression()
public void bind(T value)
public void bindSafely(T value)
public void doBindRemote(UUID hostId, T message)
protected T evaluate()
public MetaClass getMetaClass()
public Object getProperty(String propertyName)
public T getVal()
public T getVal(long timeout, TimeUnit units)
public void getValAsync(MessageStream callback)
public void getValAsync(Object attachment, MessageStream callback)
public Object invokeMethod(String name, Object args)
public boolean isBound()
public void rightShift(Closure closure)
public void setMetaClass(MetaClass metaClass)
public void setProperty(String propertyName, Object newValue)
protected final void subscribe()
protected void subscribe(DataFlowExpressionsCollector listener)
@SuppressWarnings({"ArithmeticOnVolatileField"}) @Override public String toString()
@SuppressWarnings("unchecked") public static DataFlowExpression transform(Object another, Closure closure)
public void whenBound(Closure closure)
public void whenBound(MessageStream stream)
Groovy Documentation