|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
@SuppressWarnings({"ThrowCaughtLocally", "UnqualifiedStaticUsage"}) public abstract class BlockingActor extends SequentialProcessingActor
Field Summary | |
---|---|
static java.lang.String |
AN_ACTOR_CAN_ONLY_RECEIVE_ONE_MESSAGE_AT_A_TIME
|
private static java.lang.String |
THE_ACTOR_HAS_BEEN_STOPPED
|
private static java.lang.String |
THE_ACTOR_HAS_NOT_BEEN_STARTED
|
private static long |
serialVersionUID
|
Fields inherited from class ReplyingMessageStream | |
---|---|
sender, serialVersionUID |
Fields inherited from class MessageStream | |
---|---|
serialVersionUID |
Fields inherited from class WithSerialId | |
---|---|
serialHandle, serialVersionUID |
Constructor Summary | |
BlockingActor()
|
Method Summary | |
---|---|
private void
|
checkStoppedFlags()
|
private java.lang.Object
|
enhanceAndUnwrap(ActorMessage message)
|
private void
|
enhanceReplies(ActorMessage message)
Adds reply and replyIfExists methods to the current Actor and the message. |
protected void
|
handleStart()
|
protected void
|
receive(groovy.lang.Closure handler)
Retrieves a message from the message queue, waiting, if necessary, for a message to arrive. |
protected void
|
receive(long timeout, java.util.concurrent.TimeUnit timeUnit, groovy.lang.Closure handler)
Retrieves a message from the message queue, waiting, if necessary, for a message to arrive. |
protected void
|
receive(groovy.time.Duration duration, groovy.lang.Closure handler)
Retrieves a message from the message queue, waiting, if necessary, for a message to arrive. |
protected java.lang.Object
|
receiveImpl()
Retrieves a message from the message queue, waiting, if necessary, for a message to arrive. |
protected java.lang.Object
|
receiveImpl(long timeout, java.util.concurrent.TimeUnit units)
Retrieves a message from the message queue, waiting, if necessary, for a message to arrive. |
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 MessageStream | |
---|---|
call, getRemoteClass, leftShift, reInterrupt, send, send, send, sendAndWait, sendAndWait, sendAndWait |
Methods inherited from class WithSerialId | |
---|---|
createRemoteHandle, getOrCreateSerialHandle, getRemoteClass, writeReplace |
Field Detail |
---|
public static final java.lang.String AN_ACTOR_CAN_ONLY_RECEIVE_ONE_MESSAGE_AT_A_TIME
private static final java.lang.String THE_ACTOR_HAS_BEEN_STOPPED
private static final java.lang.String THE_ACTOR_HAS_NOT_BEEN_STARTED
private static final long serialVersionUID
Constructor Detail |
---|
BlockingActor()
Method Detail |
---|
private void checkStoppedFlags()
private java.lang.Object enhanceAndUnwrap(ActorMessage message)
private void enhanceReplies(ActorMessage message)
message
- The original message
@Override protected void handleStart()
@SuppressWarnings({"MethodOverloadsMethodOfSuperclass"}) protected final void receive(groovy.lang.Closure handler)
handler
- A closure accepting the retrieved message as a parameter, which will be invoked after a message is received.
protected final void receive(long timeout, java.util.concurrent.TimeUnit timeUnit, groovy.lang.Closure handler)
timeout
- how long to wait before giving up, in units of unittimeUnit
- a TimeUnit determining how to interpret the timeout parameterhandler
- A closure accepting the retrieved message as a parameter, which will be invoked after a message is received.
@SuppressWarnings({"MethodOverloadsMethodOfSuperclass", "TypeMayBeWeakened"}) protected final void receive(groovy.time.Duration duration, groovy.lang.Closure handler)
duration
- how long to wait before giving up, in units of unithandler
- A closure accepting the retrieved message as a parameter, which will be invoked after a message is received.
@Override protected final java.lang.Object receiveImpl()
@Override protected final java.lang.Object receiveImpl(long timeout, java.util.concurrent.TimeUnit units)
timeout
- how long to wait before giving up, in units of unitunits
- a TimeUnit determining how to interpret the timeout parameter
Copyright © 2008–2012 Václav Pech. All Rights Reserved.