Package akka.testkit
Class CallingThreadMailbox
- java.lang.Object
-
- akka.dispatch.forkjoin.ForkJoinTask<scala.runtime.BoxedUnit>
-
- akka.dispatch.Mailbox
-
- akka.testkit.CallingThreadMailbox
-
- All Implemented Interfaces:
DefaultSystemMessageQueue,SystemMessageQueue,java.io.Serializable,java.lang.Runnable,java.util.concurrent.Future<scala.runtime.BoxedUnit>
public class CallingThreadMailbox extends Mailbox implements DefaultSystemMessageQueue
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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CallingThreadMailbox(Cell _receiver, MailboxType mailboxType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Overridable callback to clean up the mailbox, called when an actor is unregistered.java.util.concurrent.locks.ReentrantLockctdLock()Envelopedequeue()Try to dequeue the next message from this queue, return null failing that.voidenqueue(ActorRef receiver, Envelope msg)Try to enqueue the message to this queue, or throw an exception.booleanhasMessages()Indicates whether this queue is non-empty.MailboxTypemailboxType()MessageQueuemessageQueue()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.intnumberOfMessages()Should return the current number of messages held in this queue; may always return 0 if no other value is available efficiently.MessageQueuequeue()ActorRefself()SwitchsuspendSwitch()ActorSystemsystem()-
Methods inherited from class akka.dispatch.Mailbox
_statusDoNotCallMeDirectly, _statusDoNotCallMeDirectly_$eq, _systemQueueDoNotCallMeDirectly, _systemQueueDoNotCallMeDirectly_$eq, actor, actor_$eq, becomeClosed, canBeScheduledForExecution, Closed, currentStatus, debug, dispatcher, exec, getRawResult, isClosed, isScheduled, isSuspended, Open, processAllSystemMessages, resume, run, Scheduled, setActor, setAsIdle, setAsScheduled, setRawResult, setStatus, shouldNotProcessMask, shouldProcessMessage, shouldScheduleMask, suspend, suspendCount, suspendMask, suspendUnit, systemQueueGet, systemQueuePut, updateStatus
-
Methods inherited from class akka.dispatch.forkjoin.ForkJoinTask
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, complete, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
-
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
-
cleanUp
public void cleanUp()
Description copied from class:MailboxOverridable 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
-
ctdLock
public java.util.concurrent.locks.ReentrantLock ctdLock()
-
dequeue
public Envelope dequeue()
Description copied from class:MailboxTry to dequeue the next message from this queue, return null failing that.
-
enqueue
public void enqueue(ActorRef receiver, Envelope msg)
Description copied from class:MailboxTry to enqueue the message to this queue, or throw an exception.
-
hasMessages
public boolean hasMessages()
Description copied from class:MailboxIndicates whether this queue is non-empty.- Overrides:
hasMessagesin classMailbox- Returns:
- (undocumented)
-
mailboxType
public MailboxType mailboxType()
-
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:
messageQueuein classMailbox- Returns:
- (undocumented)
-
numberOfMessages
public int numberOfMessages()
Description copied from class:MailboxShould 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, usehasMessagesinstead.- Overrides:
numberOfMessagesin classMailbox- Returns:
- (undocumented)
-
queue
public MessageQueue queue()
-
self
public ActorRef self()
-
suspendSwitch
public Switch suspendSwitch()
-
system
public ActorSystem system()
-
-