1 22 package org.jboss.mq.il.uil2.msgs; 23 24 import java.io.ObjectInputStream ; 25 import java.io.IOException ; 26 import java.io.ObjectOutputStream ; 27 28 32 public class PingMsg extends BaseMsg 33 { 34 private long time; 35 36 public PingMsg(boolean isPing) 37 { 38 this(0, isPing); 39 } 40 public PingMsg(long time, boolean isPing) 41 { 42 super(isPing ? MsgTypes.m_ping : MsgTypes.m_pong); 43 this.time = time; 44 } 45 46 public long getTime() 47 { 48 return time; 49 } 50 51 public void write(ObjectOutputStream out) throws IOException 52 { 53 super.write(out); 54 out.writeLong(time); 55 } 56 public void read(ObjectInputStream in) throws IOException , ClassNotFoundException 57 { 58 super.read(in); 59 time = in.readLong(); 60 } 61 } 62 | Popular Tags |