01: //$Id: TokenLostException.java,v 1.3 2004/09/15 17:40:59 belaban Exp $
02:
03: package org.jgroups.protocols.ring;
04:
05: import org.jgroups.Address;
06:
07: import java.io.InterruptedIOException;
08:
09: public class TokenLostException extends InterruptedIOException {
10:
11: public static final int UNDEFINED = 0;
12: public static final int WHILE_RECEIVING = 1;
13: public static final int WHILE_SENDING = 2;
14:
15: protected Address failedNode;
16: protected Throwable cause;
17: protected int mode = UNDEFINED;
18:
19: public TokenLostException() {
20: super ();
21: }
22:
23: public TokenLostException(String message) {
24: super (message);
25: }
26:
27: public TokenLostException(String message, Throwable cause,
28: Address failedNode, int mode) {
29: super ();
30: this .failedNode = failedNode;
31: this .mode = mode;
32: }
33:
34: public int getFailureMode() {
35: return mode;
36: }
37:
38: public Address getFailedNode() {
39: return failedNode;
40: }
41:
42: public String toString() {
43: StringBuffer buf = new StringBuffer();
44: buf.append("TokenLostException[");
45: buf.append("cause=").append(cause);
46: buf.append(",failedNode=").append(failedNode);
47:
48: buf.append(']');
49: return buf.toString();
50: }
51:
52: }
|