groovyx.gpars.dataflow.operator
Class DataflowOperatorActor

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.DataflowOperatorActor
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ForkingDataflowOperatorActor

 class DataflowOperatorActor
extends DataflowProcessorActor

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

Iteratively waits for enough values from inputs. Once all required inputs are available (received as messages), the operator'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
private  java.util.Map values
           
 
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
DataflowOperatorActor(DataflowOperator owningOperator, PGroup group, java.util.List outputs, java.util.List inputs, groovy.lang.Closure code)
           
 
Method Summary
(package private)  void afterStart()
           
 void onMessage(java.lang.Object message)
          All messages unhandled by sub-classes will result in an exception being thrown
private  void queryInputs(boolean initialRun)
           
(package private)  void startTask(java.util.List<java.lang.Object> results)
           
 
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

values

private java.util.Map values
Constructor Detail

DataflowOperatorActor

DataflowOperatorActor(DataflowOperator 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

queryInputs

private void queryInputs(boolean initialRun)

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

startTask

void startTask(java.util.List<java.lang.Object> results)

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