1 /*2 * JBoss, the OpenSource J2EE webOS3 *4 * Distributable under LGPL license.5 * See terms of license at gnu.org.6 */7 package org.jboss.messaging.interfaces;8 9 /**10 * A message set.11 * 12 * @author <a HREF="mailto:adrian@jboss.org">Adrian Brock</a>13 * @version $Revision: 1.1 $14 */15 public interface MessageSet16 {17 // Constants -----------------------------------------------------18 19 // Public --------------------------------------------------------20 21 /**22 * Add a message to the message set.23 * 24 * @param reference the message reference to add25 */26 void add(MessageReference reference);27 28 /**29 * Remove a message from the message set.30 * 31 * @param consumer the consumer used to accept the message32 * @return a message or null if there are no messages33 */34 MessageReference remove(Consumer consumer);35 36 /**37 * Lock the message set38 */39 void lock();40 41 /**42 * Unlock the message set43 */44 void unlock();45 46 /**47 * Set the consumer for out of band notifications48 * 49 * @param consumer the consumer50 */51 void setConsumer(Consumer consumer);52 53 // Inner Classes --------------------------------------------------54 }55