KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.ubermq.kernel;
2
3 import java.nio.*;
4 import com.ubermq.kernel.IDatagram;
5
6 /**
7  * Takes some corrective action when an output buffer overflows, and
8  * indicates whether the output operation should be retried.
9  */

10 public interface IOverflowHandler
11     extends java.io.Serializable JavaDoc
12 {
13     public static final int ACTION_RETRY = 1,
14         ACTION_FAIL = 2,
15         ACTION_IGNORE = 3;
16     
17     /**
18      * Handles an overflow situation.
19      *
20      * @param d the IDatagram that is being sent.
21      * @return whether the caller should retry the output
22      * or not.
23      */

24     public int overflow(IDatagram d);
25
26     /**
27      * Handles an overflow situation that is not related to outputting
28      * a datagram.
29      */

30     public int overflow();
31
32     /**
33      * Produces a new overflow handler to be used if the
34      * recommended retried output attempt fails again.
35      * This can be return null if the overflow()
36      * method never returns true.
37      */

38     public IOverflowHandler getRetryHandler();
39 }
40
Popular Tags