KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > messaging > channel > interfaces > Channel


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

17 public interface Channel
18 {
19    // Constants -----------------------------------------------------
20

21    // Public --------------------------------------------------------
22

23    /**
24     * Send a message to the channel.
25     *
26     * @param reference the message reference to send
27     */

28    void send(MessageReference reference);
29
30    /**
31     * Receive a message from the channel.
32     *
33     * @param wait the length of time to wait for a message if there are none
34     * immediately available, use -1 for no wait.
35     * @return a message or null if there are no messages
36     */

37    MessageReference receive(long wait);
38    
39    /**
40     * Close the channel
41     */

42    void close();
43    
44    // Inner Classes --------------------------------------------------
45
}
46
Popular Tags