1 3 package org.jgroups.protocols.pbcast; 4 5 6 import org.jgroups.View; 7 import org.jgroups.util.Streamable; 8 import org.jgroups.util.Util; 9 10 import java.io.Serializable ; 11 import java.io.DataOutputStream ; 12 import java.io.IOException ; 13 import java.io.DataInputStream ; 14 15 16 public class JoinRsp implements Serializable , Streamable { 17 View view=null; 18 Digest digest=null; 19 20 public JoinRsp() { 21 22 } 23 24 public JoinRsp(View v, Digest d) { 25 view=v; 26 digest=d; 27 } 28 29 30 View getView() { 31 return view; 32 } 33 34 Digest getDigest() { 35 return digest; 36 } 37 38 public void writeTo(DataOutputStream out) throws IOException { 39 Util.writeStreamable(view, out); 40 Util.writeStreamable(digest, out); 41 } 42 43 public void readFrom(DataInputStream in) throws IOException , IllegalAccessException , InstantiationException { 44 view=(View)Util.readStreamable(View.class, in); 45 digest=(Digest)Util.readStreamable(Digest.class, in); 46 } 47 48 public String toString() { 49 StringBuffer sb=new StringBuffer (); 50 sb.append("view: "); 51 if(view == null) 52 sb.append("<null>"); 53 else 54 sb.append(view); 55 sb.append(", digest: "); 56 if(digest == null) 57 sb.append("<null>"); 58 else 59 sb.append(digest); 60 return sb.toString(); 61 } 62 } 63 | Popular Tags |