1 3 package org.jgroups.protocols.ring; 4 5 import org.jgroups.Address; 6 7 import java.io.InterruptedIOException ; 8 9 public class TokenLostException extends InterruptedIOException 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 cause; 18 protected int mode = UNDEFINED; 19 20 public TokenLostException() 21 { 22 super(); 23 } 24 public TokenLostException(String message) 25 { 26 super(message); 27 } 28 29 public TokenLostException(String message,Throwable 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 toString() 47 { 48 StringBuffer buf = new StringBuffer (); 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 |