akka.testkit
Class CallingThreadMailbox

java.lang.Object
  extended by akka.dispatch.Mailbox
      extended by akka.testkit.CallingThreadMailbox
All Implemented Interfaces:
DefaultSystemMessageQueue, SystemMessageQueue, java.lang.Runnable

public class CallingThreadMailbox
extends Mailbox
implements DefaultSystemMessageQueue


Constructor Summary
CallingThreadMailbox(Cell _receiver, MailboxType mailboxType)
           
 
Method Summary
 void cleanUp()
          Overridable callback to clean up the mailbox, called when an actor is unregistered.
 java.util.concurrent.locks.ReentrantLock ctdLock()
           
 Envelope dequeue()
          Try to dequeue the next message from this queue, return null failing that.
 void enqueue(ActorRef receiver, Envelope msg)
          Try to enqueue the message to this queue, or throw an exception.
 boolean hasMessages()
          Indicates whether this queue is non-empty.
 MailboxType mailboxType()
           
 MessageQueue messageQueue()
          This is only a marker to be put in the messageQueue’s stead to make error messages pertaining to violated mailbox type requirements less cryptic.
 int numberOfMessages()
          Should return the current number of messages held in this queue; may always return 0 if no other value is available efficiently.
 MessageQueue queue()
           
 ActorRef self()
           
 Switch suspendSwitch()
           
 ActorSystem system()
           
 
Methods inherited from class akka.dispatch.Mailbox
_statusDoNotCallMeDirectly, _systemQueueDoNotCallMeDirectly, actor, becomeClosed, canBeScheduledForExecution, Closed, currentStatus, debug, dispatcher, isClosed, isScheduled, isSuspended, Open, processAllSystemMessages, resume, run, Scheduled, setActor, setAsIdle, setAsScheduled, setStatus, shouldNotProcessMask, shouldProcessMessage, shouldScheduleMask, suspend, suspendCount, suspendMask, suspendUnit, systemQueueGet, systemQueuePut, updateStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.dispatch.DefaultSystemMessageQueue
hasSystemMessages, systemDrain, systemEnqueue
 
Methods inherited from interface akka.dispatch.SystemMessageQueue
hasSystemMessages, systemDrain, systemEnqueue
 

Constructor Detail

CallingThreadMailbox

public CallingThreadMailbox(Cell _receiver,
                            MailboxType mailboxType)
Method Detail

mailboxType

public MailboxType mailboxType()

system

public ActorSystem system()

self

public ActorRef self()

messageQueue

public MessageQueue messageQueue()
This is only a marker to be put in the messageQueue’s stead to make error messages pertaining to violated mailbox type requirements less cryptic.

Overrides:
messageQueue in class Mailbox
Returns:
(undocumented)

enqueue

public void enqueue(ActorRef receiver,
                    Envelope msg)
Description copied from class: Mailbox
Try to enqueue the message to this queue, or throw an exception.

Overrides:
enqueue in class Mailbox
Parameters:
receiver - (undocumented)
msg - (undocumented)

dequeue

public Envelope dequeue()
Description copied from class: Mailbox
Try to dequeue the next message from this queue, return null failing that.

Overrides:
dequeue in class Mailbox
Returns:
(undocumented)

hasMessages

public boolean hasMessages()
Description copied from class: Mailbox
Indicates whether this queue is non-empty.

Overrides:
hasMessages in class Mailbox
Returns:
(undocumented)

numberOfMessages

public int numberOfMessages()
Description copied from class: Mailbox
Should return the current number of messages held in this queue; may always return 0 if no other value is available efficiently. Do not use this for testing for presence of messages, use hasMessages instead.

Overrides:
numberOfMessages in class Mailbox
Returns:
(undocumented)

queue

public MessageQueue queue()

ctdLock

public java.util.concurrent.locks.ReentrantLock ctdLock()

suspendSwitch

public Switch suspendSwitch()

cleanUp

public void cleanUp()
Description copied from class: Mailbox
Overridable callback to clean up the mailbox, called when an actor is unregistered. By default it dequeues all system messages + messages and ships them to the owning actors' systems' DeadLetterMailbox

Overrides:
cleanUp in class Mailbox