org.codehaus.gpars

groovyx.gpars.dataflow
[Java] Class SyncDataflowStreamReadAdapter

java.lang.Object
  groovyx.gpars.dataflow.stream.DataflowStreamReadAdapter
      groovyx.gpars.dataflow.SyncDataflowStreamReadAdapter

final class SyncDataflowStreamReadAdapter
extends DataflowStreamReadAdapter

Provides a special implementation of DataflowStreamReadAdapter, which cooperates with SyncDataflowBroadcast subscription and un-subscription mechanism.

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


Field Summary
private boolean closed

private boolean wheneverBoundSet

 
Fields inherited from class DataflowStreamReadAdapter
asyncHead, eventManager, head
 
Constructor Summary
SyncDataflowStreamReadAdapter(StreamCore stream)

Creates a new adapter

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

private void checkClosed()

void close()

Closes the channel so that it cannot be used any longer

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)

boolean isBound()

java.util.Iterator iterator()

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

DataflowExpression poll()

Promise rightShift(groovy.lang.Closure closure)

DataflowReadChannel tap(PGroup group, DataflowWriteChannel target)

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 DataflowStreamReadAdapter
allUnprocessedDFVs, binaryChoice, binaryChoice, binaryChoice, binaryChoice, binaryChoice, binaryChoice, chainWith, chainWith, chainWith, chainWith, chainWith, chainWith, choice, choice, choice, choice, choice, choice, filter, filter, filter, filter, filter, filter, fireOnMessage, getEventManager, getVal, getVal, getValAsync, getValAsync, into, into, into, into, into, into, isBound, iterator, length, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, moveAsyncHead, moveHead, or, or, poll, rightShift, separate, separate, separate, separate, separate, separate, shouldReportTimeout, split, split, split, split, split, split, split, split, split, split, split, split, tap, tap, tap, tap, tap, tap, then, then, then, toString, whenBound, whenBound, whenBound, whenBound, wheneverBound, wheneverBound
 

Field Detail

closed

private boolean closed


wheneverBoundSet

private boolean wheneverBoundSet


 
Constructor Detail

SyncDataflowStreamReadAdapter

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


 
Method Detail

chainWith

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


checkClosed

private void checkClosed()


close

void close()
Closes the channel so that it cannot be used any longer
throws:
InterruptedException When the thread gets interrupted


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)


isBound

@Override
public boolean isBound()


iterator

@Override
public java.util.Iterator iterator()


merge

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


poll

@Override
public DataflowExpression poll()


rightShift

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


tap

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


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.