org.jboss.messaging.memory
Class MemoryMessageSet

java.lang.Object
  extended byorg.jboss.messaging.memory.MemoryMessageSet
All Implemented Interfaces:
MessageSet (src)

public class MemoryMessageSet
extends java.lang.Object
implements MessageSet (src)

An in memory message set


Constructor Summary
MemoryMessageSet(java.util.Comparator comparator)
          Create a new MemoryMessageSet.
 
Method Summary
 void add(MessageReference (src)  reference)
          Add a message to the message set.
 void lock()
          Lock the message set
 MessageReference (src) remove(Consumer (src)  consumer)
          Remove a message from the message set.
 void setConsumer(Consumer (src)  consumer)
          Set the consumer for out of band notifications
 void unlock()
          Unlock the message set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryMessageSet

public MemoryMessageSet(java.util.Comparator comparator)
Create a new MemoryMessageSet.

Parameters:
comparator - the comparator for the messages
Method Detail

add

public void add(MessageReference (src)  reference)
Description copied from interface: MessageSet (src)
Add a message to the message set.

Specified by:
add in interface MessageSet (src)
Parameters:
reference - the message reference to add

remove

public MessageReference (src)  remove(Consumer (src)  consumer)
Description copied from interface: MessageSet (src)
Remove a message from the message set.

Specified by:
remove in interface MessageSet (src)
Parameters:
consumer - the consumer used to accept the message
Returns:
a message or null if there are no messages

lock

public void lock()
Description copied from interface: MessageSet (src)
Lock the message set

Specified by:
lock in interface MessageSet (src)

unlock

public void unlock()
Description copied from interface: MessageSet (src)
Unlock the message set

Specified by:
unlock in interface MessageSet (src)

setConsumer

public void setConsumer(Consumer (src)  consumer)
Description copied from interface: MessageSet (src)
Set the consumer for out of band notifications

Specified by:
setConsumer in interface MessageSet (src)
Parameters:
consumer - the consumer