KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > messaging > channel > plugins > handler > ChannelHandler


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

18 public interface ChannelHandler extends Consumer
19 {
20    // Constants -----------------------------------------------------
21

22    // Public --------------------------------------------------------
23

24    /**
25     * Add a message to the channel handler.
26     *
27     * @param reference the message reference to add
28     */

29    void addMessage(MessageReference reference);
30    
31    /**
32     * Remove a message from the channel handler.
33     *
34     * @param consumer the consumer used to accept the message
35     * @return a message or null if there are no messages
36     */

37    MessageReference removeMessage(Consumer consumer);
38    
39    /**
40     * Wait for a message from the channel handler.
41     *
42     * @param consumer the consumer that will wait for a message
43     * @param wait the length of time
44     */

45    void waitMessage(Consumer consumer, long wait);
46    
47    /**
48     * Remove a consumer that is waiting for a message.
49     *
50     * @param consumer the consumer to remove.
51     */

52    void stopWaitMessage(Consumer consumer);
53    
54    // Inner Classes --------------------------------------------------
55
}
56
Popular Tags