akka.contrib.mailbox
Class PeekMailbox

java.lang.Object
  extended by akka.contrib.mailbox.PeekMailbox
All Implemented Interfaces:
MessageQueue, MultipleConsumerSemantics, QueueBasedMessageQueue, UnboundedMessageQueueSemantics, UnboundedQueueBasedMessageQueue

public class PeekMailbox
extends java.lang.Object
implements UnboundedQueueBasedMessageQueue


Constructor Summary
PeekMailbox(ActorRef owner, ActorSystem system, int maxRetries)
           
 
Method Summary
 void ack()
           
 void cleanUp(ActorRef owner, MessageQueue deadLetters)
          Called when the mailbox this queue belongs to is disposed of.
 Envelope dequeue()
          Try to dequeue the next message from this queue, return null failing that.
 int Marker()
           
 java.util.concurrent.ConcurrentLinkedQueue<Envelope> queue()
           
 int tries()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.dispatch.UnboundedQueueBasedMessageQueue
enqueue
 
Methods inherited from interface akka.dispatch.QueueBasedMessageQueue
hasMessages, numberOfMessages
 

Constructor Detail

PeekMailbox

public PeekMailbox(ActorRef owner,
                   ActorSystem system,
                   int maxRetries)
Method Detail

queue

public final java.util.concurrent.ConcurrentLinkedQueue<Envelope> queue()
Specified by:
queue in interface QueueBasedMessageQueue

tries

public int tries()

Marker

public int Marker()

dequeue

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

Specified by:
dequeue in interface MessageQueue
Specified by:
dequeue in interface UnboundedQueueBasedMessageQueue

ack

public void ack()

cleanUp

public void cleanUp(ActorRef owner,
                    MessageQueue deadLetters)
Description copied from interface: MessageQueue
Called when the mailbox this queue belongs to is disposed of. Normally it is expected to transfer all remaining messages into the dead letter queue which is passed in. The owner of this MessageQueue is passed in if available (e.g. for creating DeadLetters()), “/deadletters” otherwise.

Specified by:
cleanUp in interface MessageQueue
Specified by:
cleanUp in interface QueueBasedMessageQueue