Modifiers | Name | Description |
---|---|---|
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 |
Constructor and description |
---|
BlockingActor
() |
Type | Name and description |
---|---|
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. |
Adds reply
and replyIfExists
methods to the current Actor
and the message.
These methods will call send
on the target actor (the sender of the original message). The
reply
/replyIfExists
methods invoked on the actor will be sent to all currently
processed messages, reply
/replyIfExists
invoked on a message will send a reply to the
sender of that particular message only.
message
- The original messageRetrieves a message from the message queue, waiting, if necessary, for a message to arrive. The message retrieved from the queue is passed into the handler as the only parameter.
handler
- A closure accepting the retrieved message as a parameter, which will be invoked after a message is received.Retrieves a message from the message queue, waiting, if necessary, for a message to arrive. The message retrieved from the queue is passed into the handler as the only parameter. A null value is passed into the handler, if the timeout expires
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.Retrieves a message from the message queue, waiting, if necessary, for a message to arrive. The message retrieved from the queue is passed into the handler as the only parameter. A null value is passed into the handler, if the timeout expires
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.Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
Retrieves a message from the message queue, waiting, if necessary, for a message to arrive.
timeout
- how long to wait before giving up, in units of unitunits
- a TimeUnit
determining how to interpret the timeout parameterCopyright © 2008–2014 Václav Pech. All Rights Reserved.