KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > messaging > interfaces > Consumer


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
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 Consumer
16 {
17    // Constants -----------------------------------------------------
18

19    // Public --------------------------------------------------------
20

21    /**
22     * Check whether the consumer accepts the message.
23     *
24     * @param reference the message reference
25     * @param active whether to check for activity, pass false
26     * to test for acceptance, true when extra checks
27     * for an active consumer are required.
28     * @return true when it accepts the message, false otherwise
29     */

30    boolean accepts(MessageReference reference, boolean active);
31
32    /**
33     * Invoked when a message needs consuming
34     *
35     * @param reference the message reference
36     */

37    void onMessage(MessageReference reference);
38    
39    // Inner Classes --------------------------------------------------
40
}
41
Popular Tags