KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgroups > protocols > ring > TokenLostException


1 //$Id: TokenLostException.java,v 1.3 2004/09/15 17:40:59 belaban Exp $
2

3 package org.jgroups.protocols.ring;
4
5 import org.jgroups.Address;
6
7 import java.io.InterruptedIOException JavaDoc;
8
9 public class TokenLostException extends InterruptedIOException JavaDoc
10 {
11
12    public static final int UNDEFINED = 0;
13    public static final int WHILE_RECEIVING = 1;
14    public static final int WHILE_SENDING =2;
15
16    protected Address failedNode;
17    protected Throwable JavaDoc cause;
18    protected int mode = UNDEFINED;
19
20    public TokenLostException()
21    {
22       super();
23    }
24    public TokenLostException(String JavaDoc message)
25    {
26       super(message);
27    }
28
29    public TokenLostException(String JavaDoc message,Throwable JavaDoc cause,Address failedNode, int mode)
30    {
31       super();
32       this.failedNode = failedNode;
33       this.mode = mode;
34    }
35
36    public int getFailureMode()
37    {
38       return mode;
39    }
40
41    public Address getFailedNode()
42    {
43       return failedNode;
44    }
45
46    public String JavaDoc toString()
47    {
48       StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
49       buf.append("TokenLostException[");
50       buf.append("cause=").append(cause);
51       buf.append(",failedNode=").append(failedNode);
52
53       buf.append(']');
54       return buf.toString();
55    }
56
57 }
58
Popular Tags