|
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.AbstractLoopingActor
public abstract class AbstractLoopingActor extends Actor
Wraps all actors that repeatedly loop through incoming messages and hold no implicit state between subsequent messages.
Field Summary | |
---|---|
private AsyncMessagingCore |
core
|
private MessageStream |
currentSender
|
private ActorTimerTask |
currentTimerTask
|
private static long |
serialVersionUID
|
private boolean |
stoppedFlag
|
private boolean |
terminatedFlag
|
boolean |
terminatingFlag
|
private int |
timeoutCounter
|
Fields inherited from class MessageStream | |
---|---|
serialVersionUID |
Fields inherited from class WithSerialId | |
---|---|
serialHandle, serialVersionUID |
Constructor Summary | |
AbstractLoopingActor()
|
Method Summary | |
---|---|
private void
|
cancelCurrentTimeoutTask()
|
private Actor
|
doStart()
|
AsyncMessagingCore
|
getCore()
|
MessageStream
|
getSender()
|
protected boolean
|
hasBeenStopped()
|
protected void
|
initialize(groovy.lang.Closure code)
|
boolean
|
isActive()
Removes the head of the message queue |
boolean
|
isFair()
Retrieves the actor's fairness flag Fair actors give up the thread after processing each message, non-fair actors keep a thread until their message queue is empty. |
void
|
makeFair()
|
void
|
reply(java.lang.Object message)
Sends a reply to all currently processed messages, which have been sent by an actor. |
void
|
replyIfExists(java.lang.Object message)
|
private void
|
runEnhancedWithoutRepliesOnMessages(ActorMessage message, groovy.lang.Closure code, java.lang.Object arguments)
|
MessageStream
|
send(java.lang.Object message)
|
void
|
setParallelGroup(PGroup group)
|
protected void
|
setTimeout(long timeout)
|
Actor
|
silentStart()
Starts the Actor and sends it the START_MESSAGE to run any afterStart handlers. |
Actor
|
start()
|
Actor
|
stop()
|
protected ActorMessage
|
sweepNextMessage()
|
Actor
|
terminate()
|
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 |
---|
private AsyncMessagingCore core
private MessageStream currentSender
private ActorTimerTask currentTimerTask
private static final long serialVersionUID
private boolean stoppedFlag
private boolean terminatedFlag
boolean terminatingFlag
private int timeoutCounter
Constructor Detail |
---|
AbstractLoopingActor()
Method Detail |
---|
private void cancelCurrentTimeoutTask()
private Actor doStart()
final AsyncMessagingCore getCore()
public final MessageStream getSender()
@java.lang.Override} protected final boolean hasBeenStopped()
protected final void initialize(groovy.lang.Closure code)
@java.lang.Override public final boolean isActive()
public final boolean isFair()
public final void makeFair()
public final void reply(java.lang.Object message)
message
- reply message
public final void replyIfExists(java.lang.Object message)
private void runEnhancedWithoutRepliesOnMessages(ActorMessage message, groovy.lang.Closure code, java.lang.Object arguments)
@java.lang.Overridereturn currentSender; public MessageStream send(java.lang.Object message)
@java.lang.Override* public void setParallelGroup(PGroup group)
protected final void setTimeout(long timeout)
@java.lang.Override public Actor silentStart()
@java.lang.Overrideif (!hasBeenStopped()) { public Actor start()
@java.lang.Overrideif (isActorThread()) { public final Actor stop()
@java.lang.Override* protected ActorMessage sweepNextMessage()
@java.lang.OverridecurrentThread.interrupt(); //NPE may occur non-deterministically, since we're running concurrently with the actor's thread public final Actor terminate()
Copyright © 2008–2013 Václav Pech. All Rights Reserved.