async.common
Interface MessageQueue

All Known Implementing Classes:
ASyncTCPMessageQueue, ASyncUDPMessageQueue

public interface MessageQueue

A queue of messages to be delivered to some destination.

Author:
Michael Parker

Method Summary
 MessageHandle enqueue(Message msg)
          Enqueues the Message argument for delivery to the destination.
 int getLength()
          Returns the number of messages enqueued to the destination.
 MessageHandle getSending()
          Returns the handle to the message currently being sent.
 boolean isEmpty()
          Returns whether any messages present in this queue.
 

Method Detail

enqueue

MessageHandle enqueue(Message msg)
Enqueues the Message argument for delivery to the destination.

Parameters:
msg - the Message to enqueue for delivery
Returns:
a handle to the enqueued message

getLength

int getLength()
Returns the number of messages enqueued to the destination.

Returns:
the number of enqueued messages

isEmpty

boolean isEmpty()
Returns whether any messages present in this queue. This message returns true if and only if method getLength returns 0.

Returns:
true if no messages are enqueued, false otherwise

getSending

MessageHandle getSending()
Returns the handle to the message currently being sent.

Returns:
handle to the message being sent