groovyx.gpars.dataflow.operator
Class DataflowSelectorActor

java.lang.Object
  extended by groovyx.gpars.serial.WithSerialId
      extended by groovyx.gpars.actor.impl.MessageStream
          extended by groovyx.gpars.actor.Actor
              extended by groovyx.gpars.actor.AbstractLoopingActor
                  extended by groovyx.gpars.actor.StaticDispatchActor<java.lang.Object>
                      extended by groovyx.gpars.dataflow.operator.DataflowProcessorActor
                          extended by groovyx.gpars.dataflow.operator.DataflowSelectorActor
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ForkingDataflowSelectorActor

 class DataflowSelectorActor
extends DataflowProcessorActor

An selector's internal actor. Repeatedly polls inputs and once they're all available it performs the selector's body.

Iteratively waits for values on the inputs. Once all a value is available (received as a message), the selector's body is run.

Author:
Vaclav Pech

Nested Class Summary
 
Nested classes/interfaces inherited from class groovyx.gpars.actor.Actor
Actor.MyRemoteHandle, Actor.RemoteActor
 
Nested classes/interfaces inherited from class groovyx.gpars.actor.impl.MessageStream
MessageStream.RemoteMessageStream, MessageStream.SendTo
 
Field Summary
protected  boolean passIndex
           
 
Fields inherited from class groovyx.gpars.dataflow.operator.DataflowProcessorActor
CANNOT_OBTAIN_THE_SEMAPHORE_TO_FORK_OPERATOR_S_BODY, code, inputs, outputs, owningProcessor, stoppingGently
 
Fields inherited from class groovyx.gpars.actor.Actor
ACTOR_HAS_ALREADY_BEEN_STARTED, CANNOT_SEND_REPLIES_NO_SENDER_HAS_BEEN_REGISTERED, currentThread, parallelGroup, START_MESSAGE, STOP_MESSAGE, TERMINATE_MESSAGE, TIMEOUT, TIMEOUT_MESSAGE, timer
 
Fields inherited from class groovyx.gpars.serial.WithSerialId
serialHandle
 
Constructor Summary
DataflowSelectorActor(DataflowSelector owningOperator, PGroup group, java.util.List outputs, java.util.List inputs, groovy.lang.Closure code)
           
 
Method Summary
(package private)  void afterStart()
           
private  void handlePoisonPillInSelector(int index, java.lang.Object value)
           
 void onMessage(java.lang.Object message)
          All messages unhandled by sub-classes will result in an exception being thrown
(package private)  void startTask(int index, java.lang.Object result)
           
 
Methods inherited from class groovyx.gpars.dataflow.operator.DataflowProcessorActor
afterStop, fireMessageArrived, forwardPoisonPill, checkPoison, isControlMessage, onException, registerChannelListenersToAllInputs, reportException, send
 
Methods inherited from class groovyx.gpars.actor.AbstractLoopingActor
getSender, hasBeenStopped, initialize, isActive, isFair, makeFair, reply, replyIfExists, setParallelGroup, setTimeout, silentStart, start, stop, sweepNextMessage, terminate
 
Methods inherited from class groovyx.gpars.actor.Actor
createActorMessage, createRemoteHandle, deregisterCurrentActorWithThread, getJoinLatch, getParallelGroup, handleException, handleInterrupt, handleStart, handleTermination, handleTimeout, isActorThread, join, join, join, join, onStop, registerCurrentActorWithThread, sendAndContinue, sendAndPromise, threadBoundActor
 
Methods inherited from class groovyx.gpars.actor.impl.MessageStream
call, getRemoteClass, leftShift, send, send, sendAndWait, sendAndWait, sendAndWait
 
Methods inherited from class groovyx.gpars.serial.WithSerialId
getOrCreateSerialHandle, writeReplace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

passIndex

protected final boolean passIndex
Constructor Detail

DataflowSelectorActor

DataflowSelectorActor(DataflowSelector owningOperator,
                      PGroup group,
                      java.util.List outputs,
                      java.util.List inputs,
                      groovy.lang.Closure code)
Method Detail

afterStart

final void afterStart()
Overrides:
afterStart in class DataflowProcessorActor

onMessage

public final void onMessage(java.lang.Object message)
Description copied from class: DataflowProcessorActor
All messages unhandled by sub-classes will result in an exception being thrown

Overrides:
onMessage in class DataflowProcessorActor
Parameters:
message - The unhandled message

handlePoisonPillInSelector

private void handlePoisonPillInSelector(int index,
                                        java.lang.Object value)

startTask

void startTask(int index,
               java.lang.Object result)

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