KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > messaging > AcceptAllConsumer


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.test.messaging;
8
9 import org.jboss.messaging.interfaces.Consumer;
10 import org.jboss.messaging.interfaces.MessageReference;
11
12 /**
13  * A consumer that accepts all messages
14  *
15  * @author <a HREF="mailto:adrian@jboss.org">Adrian Brock</a>
16  * @version $Revision: 1.1 $
17  */

18 public class AcceptAllConsumer implements Consumer
19 {
20    // Constants -----------------------------------------------------
21

22    // Attributes ----------------------------------------------------
23

24    // Static --------------------------------------------------------
25

26    // Constructors --------------------------------------------------
27

28    // Public --------------------------------------------------------
29

30    // Consumer implementation ---------------------------------------
31

32    public boolean accepts(MessageReference reference, boolean active)
33    {
34       return true;
35    }
36
37    public void onMessage(MessageReference reference)
38    {
39    }
40    
41    // Protected -----------------------------------------------------
42

43    // Package Private -----------------------------------------------
44

45    // Private -------------------------------------------------------
46

47    // Inner Classes -------------------------------------------------
48
}
49
Popular Tags