1 3 package org.jgroups.stack; 4 5 6 import org.jgroups.Address; 7 8 import java.util.Vector ; 9 10 11 20 public class StateTransferInfo { 21 public static final int GET_FROM_SINGLE=1; public static final int GET_FROM_MANY=2; 24 public Address requester=null; 25 public int type=GET_FROM_SINGLE; 26 public Address target=null; 27 public Vector targets=null; 28 public long timeout=0; 29 30 31 public StateTransferInfo(Address requester, int type, Address target) { 32 this.requester=requester; 33 this.type=type; 34 this.target=target; 35 } 36 37 public StateTransferInfo(int type, Address target) { 38 this.type=type; 39 this.target=target; 40 } 41 42 43 public StateTransferInfo(int type, Vector targets) { 44 this.type=type; 45 this.targets=targets; 46 } 47 48 49 public String toString() { 50 StringBuffer ret=new StringBuffer (); 51 ret.append("type=" + (type == GET_FROM_MANY ? "GET_FROM_MANY" : "GET_FROM_SINGLE") + ", "); 52 if(type == GET_FROM_MANY) 53 ret.append("targets=" + targets); 54 else 55 ret.append("target=" + target); 56 ret.append(", timeout=" + timeout); 57 return ret.toString(); 58 } 59 } 60 | Popular Tags |