org.codehaus.gpars

groovyx.gpars.actor.impl
[Java] Class RunnableBackedBlockingActor

java.lang.Object
  groovyx.gpars.serial.WithSerialId
      groovyx.gpars.actor.impl.MessageStream
          groovyx.gpars.actor.Actor
              groovyx.gpars.actor.impl.ReplyingMessageStream
                  groovyx.gpars.actor.impl.SequentialProcessingActor
                      groovyx.gpars.actor.BlockingActor
                          groovyx.gpars.actor.impl.RunnableBackedBlockingActor

public class RunnableBackedBlockingActor
extends BlockingActor

Utility class to implement a blocking actor backed by any Runnable (including Closure)

Authors:
Alex Tkachman, Vaclav Pech


Nested Class Summary
private static class RunnableBackedBlockingActor.RunnableBackedPooledActorDelegate

 
Field Summary
private java.lang.Runnable action

private static long serialVersionUID

 
Fields inherited from class BlockingActor
AN_ACTOR_CAN_ONLY_RECEIVE_ONE_MESSAGE_AT_A_TIME, THE_ACTOR_HAS_BEEN_STOPPED, THE_ACTOR_HAS_NOT_BEEN_STARTED, serialVersionUID
 
Fields inherited from class SequentialProcessingActor
SHOULD_NOT_REACH_HERE, S_ACTIVE_MASK, S_FINISHED_MASK, S_FINISHING_MASK, S_NOT_STARTED, S_RUNNING, S_STOPPED, S_STOPPING, S_STOP_TERMINATE_MASK, S_TERMINATED, S_TERMINATING, inputQueue, inputQueueUpdater, ongoingThreadTermination, outputQueue, serialVersionUID, stopFlag, stopFlagUpdater, waitingThread
 
Fields inherited from class ReplyingMessageStream
sender, serialVersionUID
 
Fields inherited from class Actor
ACTOR_HAS_ALREADY_BEEN_STARTED, AFTER_START, CANNOT_SEND_REPLIES_NO_SENDER_HAS_BEEN_REGISTERED, EMPTY_ARGUMENTS, ON_DELIVERY_ERROR, RESPONDS_TO, START_MESSAGE, STOP_MESSAGE, TERMINATE_MESSAGE, TIMEOUT, TIMEOUT_MESSAGE, currentActorPerThread, currentThread, joinLatch, onStop, parallelGroup, serialVersionUID, timer
 
Fields inherited from class MessageStream
serialVersionUID
 
Fields inherited from class WithSerialId
serialHandle, serialVersionUID
 
Constructor Summary
RunnableBackedBlockingActor(java.lang.Runnable handler)

 
Method Summary
protected void act()

protected void setAction(java.lang.Runnable handler)

 
Methods inherited from class BlockingActor
checkStoppedFlags, enhanceAndUnwrap, enhanceReplies, handleStart, receive, receive, receive, receiveImpl, receiveImpl
 
Methods inherited from class SequentialProcessingActor
act, awaitNextMessage, checkStopTerminate, handleTermination, hasBeenStopped, isActive, pollMessage, receive, receive, receive, receiveImpl, receiveImpl, retrieveNextMessage, run, send, setParallelGroup, silentStart, start, stop, sweepNextMessage, takeMessage, takeMessage, terminate, throwIfNeeded, transferQueues, unwrapMessage
 
Methods inherited from class ReplyingMessageStream
getSender, reply, replyIfExists, setSender
 
Methods inherited from class Actor
callDynamic, createActorMessage, createRemoteHandle, deregisterCurrentActorWithThread, getJoinLatch, getParallelGroup, handleException, handleInterrupt, handleStart, handleTermination, handleTimeout, hasBeenStopped, isActive, isActorThread, join, join, join, join, onStop, registerCurrentActorWithThread, sendAndContinue, sendAndPromise, setParallelGroup, silentStart, start, stop, sweepNextMessage, sweepQueue, terminate, threadBoundActor
 
Methods inherited from class MessageStream
call, getRemoteClass, leftShift, reInterrupt, send, send, send, sendAndWait, sendAndWait, sendAndWait
 
Methods inherited from class WithSerialId
createRemoteHandle, getOrCreateSerialHandle, getRemoteClass, writeReplace
 

Field Detail

action

private java.lang.Runnable action


serialVersionUID

private static final long serialVersionUID


 
Constructor Detail

RunnableBackedBlockingActor

public RunnableBackedBlockingActor(java.lang.Runnable handler)


 
Method Detail

act

@java.lang.SuppressWarnings
@java.lang.OverrideRunnableBackedPooledActorDelegate(final Object first, final Object second) {
protected final void act()


setAction

protected final void setAction(java.lang.Runnable handler)


 

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