KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > kernel > DatagramSink


1 package com.ubermq.kernel;
2
3 import com.ubermq.kernel.*;
4 import java.io.*;
5 import java.nio.*;
6
7 /**
8  * An I/O oriented sink for datagrams, providing
9  * output capability to abstract endpoints. Overflow
10  * and failure handling is also a requirement for callers.<P>
11  *
12  * If a datagram is to be routed inside the local JVM,
13  * the DatagramEndpoint interface is a more appropriate choice.<P>
14  *
15  * @see com.ubermq.kernel.IDatagramEndpoint
16  */

17 public interface DatagramSink
18 {
19     /**
20      * Determines whether the sink is available for output,
21      * and whether an <code>output</code> would most likely
22      * succeed.
23      *
24      * @return true if the output dest node is available
25      */

26     public boolean isOpen();
27
28     /**
29      * Outputs a datagram. If the datagram causes an overflow,
30      * the given overflow handler is called to determine whether the
31      * operation should be retried.
32      *
33      * @param d a datagram
34      * @param h the overflow handler to use
35      * @throws IOException if the endpoint is not open, or the
36      * endpoint failed during the output call and is no longer valid.
37      */

38     public void output(IDatagram d, IOverflowHandler h)
39         throws IOException;
40 }
41
Popular Tags