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 consumer of messages.11 * 12 * @author <a HREF="mailto:adrian@jboss.org">Adrian Brock</a>13 * @version $Revision: 1.1 $14 */15 public interface Consumer16 {17 // Constants -----------------------------------------------------18 19 // Public --------------------------------------------------------20 21 /**22 * Check whether the consumer accepts the message.23 * 24 * @param reference the message reference25 * @param active whether to check for activity, pass false26 * to test for acceptance, true when extra checks27 * for an active consumer are required.28 * @return true when it accepts the message, false otherwise29 */30 boolean accepts(MessageReference reference, boolean active);31 32 /**33 * Invoked when a message needs consuming34 * 35 * @param reference the message reference36 */37 void onMessage(MessageReference reference);38 39 // Inner Classes --------------------------------------------------40 }41