groovyx.gpars.actor
Class StaticDispatchActor<T>

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

public abstract class StaticDispatchActor<T>
extends AbstractLoopingActor

Offers a statically dispatched and thus slightly faster alternative to the DynamicDispatchActor class. Message handlers are discovered at compile-time.

See Also:
Serialized Form

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 static long serialVersionUID
           
 
Fields inherited from class groovyx.gpars.actor.AbstractLoopingActor
terminatingFlag
 
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
protected StaticDispatchActor()
          Creates a new instance
 
Method Summary
abstract  void onMessage(T message)
          Handles the incoming messages.
 
Methods inherited from class groovyx.gpars.actor.AbstractLoopingActor
getCore, getSender, hasBeenStopped, initialize, isActive, isFair, makeFair, reply, replyIfExists, send, 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, sweepQueue, 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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

StaticDispatchActor

protected StaticDispatchActor()
Creates a new instance

Method Detail

onMessage

public abstract void onMessage(T message)
Handles the incoming messages. Needs to be implemented in sub-classes.

Parameters:
message - The message at the head of the mail box

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