org.codehaus.gpars

groovyx.gpars.dataflow.stream
[Java] Class DataflowStreamReadAdapter

java.lang.Object
  groovyx.gpars.dataflow.stream.DataflowStreamReadAdapter
All Implemented Interfaces:
DataflowReadChannel

@SuppressWarnings({"unchecked"})
public class DataflowStreamReadAdapter

Adapts a DataflowStream to accommodate for the DataflowReadChannel interface. To minimize the overhead and stay in-line with the DataflowStream semantics, the DataflowStreamReadAdapter class is not thread-safe and should only be used from within a single thread. If multiple threads need to read from a DataflowStream, they should each create their own wrapping DataflowStreamReadAdapter.

Parameters:
- The type of messages to pass through the stream
Authors:
Vaclav Pech


Field Summary
private StreamCore asyncHead

private DataflowChannelEventOrchestrator eventManager

private StreamCore head

 
Constructor Summary
DataflowStreamReadAdapter(StreamCore stream)

Creates a new adapter

 
Method Summary
protected java.util.List allUnprocessedDFVs()

void binaryChoice(DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

void binaryChoice(Pool pool, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

void binaryChoice(PGroup group, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

void binaryChoice(java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

void binaryChoice(Pool pool, java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

void binaryChoice(PGroup group, java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

DataflowReadChannel chainWith(groovy.lang.Closure closure)

DataflowReadChannel chainWith(Pool pool, groovy.lang.Closure closure)

DataflowReadChannel chainWith(PGroup group, groovy.lang.Closure closure)

DataflowReadChannel chainWith(java.util.Map params, groovy.lang.Closure closure)

DataflowReadChannel chainWith(Pool pool, java.util.Map params, groovy.lang.Closure closure)

DataflowReadChannel chainWith(PGroup group, java.util.Map params, groovy.lang.Closure closure)

void choice(java.util.List outputs, groovy.lang.Closure code)

void choice(Pool pool, java.util.List outputs, groovy.lang.Closure code)

void choice(PGroup group, java.util.List outputs, groovy.lang.Closure code)

void choice(java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

void choice(Pool pool, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

void choice(PGroup group, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

DataflowReadChannel filter(groovy.lang.Closure closure)

DataflowReadChannel filter(Pool pool, groovy.lang.Closure closure)

DataflowReadChannel filter(PGroup group, groovy.lang.Closure closure)

DataflowReadChannel filter(java.util.Map params, groovy.lang.Closure closure)

DataflowReadChannel filter(Pool pool, java.util.Map params, groovy.lang.Closure closure)

DataflowReadChannel filter(PGroup group, java.util.Map params, groovy.lang.Closure closure)

private void fireOnMessage(java.lang.Object value)

DataflowChannelEventListenerManager getEventManager()

java.lang.Object getVal()

java.lang.Object getVal(long timeout, java.util.concurrent.TimeUnit units)

void getValAsync(MessageStream callback)

void getValAsync(java.lang.Object attachment, MessageStream callback)

void into(DataflowWriteChannel target)

void into(Pool pool, DataflowWriteChannel target)

void into(PGroup group, DataflowWriteChannel target)

void into(java.util.Map params, DataflowWriteChannel target)

void into(Pool pool, java.util.Map params, DataflowWriteChannel target)

void into(PGroup group, java.util.Map params, DataflowWriteChannel target)

boolean isBound()

java.util.Iterator iterator()

int length()

Returns the current size of the buffer

DataflowReadChannel merge(DataflowReadChannel other, groovy.lang.Closure closure)

DataflowReadChannel merge(Pool pool, DataflowReadChannel other, groovy.lang.Closure closure)

DataflowReadChannel merge(PGroup group, DataflowReadChannel other, groovy.lang.Closure closure)

DataflowReadChannel merge(java.util.List others, groovy.lang.Closure closure)

DataflowReadChannel merge(Pool pool, java.util.List others, groovy.lang.Closure closure)

DataflowReadChannel merge(PGroup group, java.util.List others, groovy.lang.Closure closure)

DataflowReadChannel merge(java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)

DataflowReadChannel merge(Pool pool, java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)

DataflowReadChannel merge(PGroup group, java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)

DataflowReadChannel merge(java.util.Map params, java.util.List others, groovy.lang.Closure closure)

DataflowReadChannel merge(Pool pool, java.util.Map params, java.util.List others, groovy.lang.Closure closure)

DataflowReadChannel merge(PGroup group, java.util.Map params, java.util.List others, groovy.lang.Closure closure)

private void moveAsyncHead()

private void moveHead()

DataflowReadChannel or(groovy.lang.Closure closure)

void or(DataflowWriteChannel target)

DataflowExpression poll()

Promise rightShift(groovy.lang.Closure closure)

void separate(java.util.List outputs, groovy.lang.Closure code)

void separate(Pool pool, java.util.List outputs, groovy.lang.Closure code)

void separate(PGroup group, java.util.List outputs, groovy.lang.Closure code)

void separate(java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

void separate(Pool pool, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

void separate(PGroup group, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

private boolean shouldReportTimeout()

void split(DataflowWriteChannel target1, DataflowWriteChannel target2)

void split(Pool pool, DataflowWriteChannel target1, DataflowWriteChannel target2)

void split(PGroup group, DataflowWriteChannel target1, DataflowWriteChannel target2)

void split(java.util.List targets)

void split(Pool pool, java.util.List targets)

void split(PGroup group, java.util.List targets)

void split(java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)

void split(Pool pool, java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)

void split(PGroup group, java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)

void split(java.util.Map params, java.util.List targets)

void split(Pool pool, java.util.Map params, java.util.List targets)

void split(PGroup group, java.util.Map params, java.util.List targets)

DataflowReadChannel tap(DataflowWriteChannel target)

DataflowReadChannel tap(Pool pool, DataflowWriteChannel target)

DataflowReadChannel tap(PGroup group, DataflowWriteChannel target)

DataflowReadChannel tap(java.util.Map params, DataflowWriteChannel target)

DataflowReadChannel tap(Pool pool, java.util.Map params, DataflowWriteChannel target)

DataflowReadChannel tap(PGroup group, java.util.Map params, DataflowWriteChannel target)

Promise then(groovy.lang.Closure closure)

Schedule closure to be executed after data became available.

Promise then(Pool pool, groovy.lang.Closure closure)

Schedule closure to be executed after data becomes available.

Promise then(PGroup group, groovy.lang.Closure closure)

Schedule closure to be executed after data becomes available.

java.lang.String toString()

void whenBound(groovy.lang.Closure closure)

void whenBound(Pool pool, groovy.lang.Closure closure)

Schedule closure to be executed by pooled actor after data becomes available.

void whenBound(PGroup group, groovy.lang.Closure closure)

void whenBound(MessageStream stream)

void wheneverBound(groovy.lang.Closure closure)

void wheneverBound(MessageStream stream)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(), 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

asyncHead

private StreamCore asyncHead


eventManager

private DataflowChannelEventOrchestrator eventManager


head

private StreamCore head


 
Constructor Detail

DataflowStreamReadAdapter

public DataflowStreamReadAdapter(StreamCore stream)
Creates a new adapter
Parameters:
stream - The stream to wrap


 
Method Detail

allUnprocessedDFVs

protected final java.util.List allUnprocessedDFVs()


binaryChoice

@Override
public void binaryChoice(DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)


binaryChoice

@Override
public void binaryChoice(Pool pool, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)


binaryChoice

@Override
public void binaryChoice(PGroup group, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)


binaryChoice

@Override
public void binaryChoice(java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)


binaryChoice

@Override
public void binaryChoice(Pool pool, java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)


binaryChoice

@Override
public void binaryChoice(PGroup group, java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)


chainWith

@Override
public final DataflowReadChannel chainWith(groovy.lang.Closure closure)


chainWith

@Override
public final DataflowReadChannel chainWith(Pool pool, groovy.lang.Closure closure)


chainWith

@Override
public DataflowReadChannel chainWith(PGroup group, groovy.lang.Closure closure)


chainWith

@Override
public final DataflowReadChannel chainWith(java.util.Map params, groovy.lang.Closure closure)


chainWith

@Override
public final DataflowReadChannel chainWith(Pool pool, java.util.Map params, groovy.lang.Closure closure)


chainWith

@Override
public DataflowReadChannel chainWith(PGroup group, java.util.Map params, groovy.lang.Closure closure)


choice

@Override
public void choice(java.util.List outputs, groovy.lang.Closure code)


choice

@Override
public void choice(Pool pool, java.util.List outputs, groovy.lang.Closure code)


choice

@Override
public void choice(PGroup group, java.util.List outputs, groovy.lang.Closure code)


choice

@Override
public void choice(java.util.Map params, java.util.List outputs, groovy.lang.Closure code)


choice

@Override
public void choice(Pool pool, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)


choice

@Override
public void choice(PGroup group, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)


filter

@Override
public DataflowReadChannel filter(groovy.lang.Closure closure)


filter

@Override
public DataflowReadChannel filter(Pool pool, groovy.lang.Closure closure)


filter

@Override
public DataflowReadChannel filter(PGroup group, groovy.lang.Closure closure)


filter

@Override
public DataflowReadChannel filter(java.util.Map params, groovy.lang.Closure closure)


filter

@Override
public DataflowReadChannel filter(Pool pool, java.util.Map params, groovy.lang.Closure closure)


filter

@Override
public DataflowReadChannel filter(PGroup group, java.util.Map params, groovy.lang.Closure closure)


fireOnMessage

private void fireOnMessage(java.lang.Object value)


getEventManager

@Override
public DataflowChannelEventListenerManager getEventManager()


getVal

@Override
public java.lang.Object getVal()


getVal

@Override
public java.lang.Object getVal(long timeout, java.util.concurrent.TimeUnit units)


getValAsync

@Override
public void getValAsync(MessageStream callback)


getValAsync

@Override
public void getValAsync(java.lang.Object attachment, MessageStream callback)


into

@Override
public void into(DataflowWriteChannel target)


into

@Override
public void into(Pool pool, DataflowWriteChannel target)


into

@Override
public void into(PGroup group, DataflowWriteChannel target)


into

@Override
public void into(java.util.Map params, DataflowWriteChannel target)


into

@Override
public void into(Pool pool, java.util.Map params, DataflowWriteChannel target)


into

@Override
public void into(PGroup group, java.util.Map params, DataflowWriteChannel target)


isBound

@Override
public boolean isBound()


iterator

public java.util.Iterator iterator()


length

@Override
public int length()
Returns the current size of the buffer
Returns:
Number of DFVs in the queue


merge

@Override
public DataflowReadChannel merge(DataflowReadChannel other, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(Pool pool, DataflowReadChannel other, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(PGroup group, DataflowReadChannel other, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(java.util.List others, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(Pool pool, java.util.List others, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(PGroup group, java.util.List others, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(Pool pool, java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(PGroup group, java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(java.util.Map params, java.util.List others, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(Pool pool, java.util.Map params, java.util.List others, groovy.lang.Closure closure)


merge

@Override
public DataflowReadChannel merge(PGroup group, java.util.Map params, java.util.List others, groovy.lang.Closure closure)


moveAsyncHead

private void moveAsyncHead()


moveHead

private void moveHead()


or

@Override
public DataflowReadChannel or(groovy.lang.Closure closure)


or

@Override
public void or(DataflowWriteChannel target)


poll

@Override
public DataflowExpression poll()


rightShift

@Override
public Promise rightShift(groovy.lang.Closure closure)


separate

@Override
public void separate(java.util.List outputs, groovy.lang.Closure code)


separate

@Override
public void separate(Pool pool, java.util.List outputs, groovy.lang.Closure code)


separate

@Override
public void separate(PGroup group, java.util.List outputs, groovy.lang.Closure code)


separate

@Override
public void separate(java.util.Map params, java.util.List outputs, groovy.lang.Closure code)


separate

@Override
public void separate(Pool pool, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)


separate

@Override
public void separate(PGroup group, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)


shouldReportTimeout

private boolean shouldReportTimeout()


split

@Override
public void split(DataflowWriteChannel target1, DataflowWriteChannel target2)


split

@Override
public void split(Pool pool, DataflowWriteChannel target1, DataflowWriteChannel target2)


split

@Override
public void split(PGroup group, DataflowWriteChannel target1, DataflowWriteChannel target2)


split

@Override
public void split(java.util.List targets)


split

@Override
public void split(Pool pool, java.util.List targets)


split

@Override
public void split(PGroup group, java.util.List targets)


split

@Override
public void split(java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)


split

@Override
public void split(Pool pool, java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)


split

@Override
public void split(PGroup group, java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)


split

@Override
public void split(java.util.Map params, java.util.List targets)


split

@Override
public void split(Pool pool, java.util.Map params, java.util.List targets)


split

@Override
public void split(PGroup group, java.util.Map params, java.util.List targets)


tap

@Override
public DataflowReadChannel tap(DataflowWriteChannel target)


tap

@Override
public DataflowReadChannel tap(Pool pool, DataflowWriteChannel target)


tap

@Override
public DataflowReadChannel tap(PGroup group, DataflowWriteChannel target)


tap

@Override
public DataflowReadChannel tap(java.util.Map params, DataflowWriteChannel target)


tap

@Override
public DataflowReadChannel tap(Pool pool, java.util.Map params, DataflowWriteChannel target)


tap

@Override
public DataflowReadChannel tap(PGroup group, java.util.Map params, DataflowWriteChannel target)


then

@Override
public final Promise then(groovy.lang.Closure closure)
Schedule closure to be executed after data became available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled
Parameters:
closure - closure to execute when data becomes available. The closure should take at most one argument.
Returns:
A promise for the results of the supplied closure. This allows for chaining of then() method calls.


then

@Override
public Promise then(Pool pool, groovy.lang.Closure closure)
Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
Parameters:
pool - The thread pool to use for task scheduling for asynchronous message delivery
closure - closure to execute when data becomes available. The closure should take at most one argument.
Returns:
A promise for the results of the supplied closure. This allows for chaining of then() method calls.


then

@Override
public Promise then(PGroup group, groovy.lang.Closure closure)
Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
Parameters:
group - The PGroup to use for task scheduling for asynchronous message delivery
closure - closure to execute when data becomes available. The closure should take at most one argument.
Returns:
A promise for the results of the supplied closure. This allows for chaining of then() method calls.


toString

@SuppressWarnings("ObjectToString")
@Override
public final java.lang.String toString()


whenBound

@Override
public void whenBound(groovy.lang.Closure closure)


whenBound

@Override
public void whenBound(Pool pool, groovy.lang.Closure closure)
Schedule closure to be executed by pooled actor after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
Parameters:
pool - The thread pool to use for task scheduling for asynchronous message delivery
closure - closure to execute when data becomes available. The closure should take at most one argument.


whenBound

@Override
public void whenBound(PGroup group, groovy.lang.Closure closure)


whenBound

@Override
public void whenBound(MessageStream stream)


wheneverBound

@Override
public void wheneverBound(groovy.lang.Closure closure)


wheneverBound

@Override
public void wheneverBound(MessageStream stream)


 

Copyright © 2008–2012 Václav Pech. All Rights Reserved.