1 22 package org.jboss.mq.il.uil2.msgs; 23 24 import java.io.ObjectOutputStream ; 25 import java.io.IOException ; 26 import java.io.ObjectInputStream ; 27 import org.jboss.mq.AcknowledgementRequest; 28 29 33 public class AcknowledgementRequestMsg extends BaseMsg 34 { 35 private AcknowledgementRequest item; 36 37 public AcknowledgementRequestMsg() 38 { 39 this(new AcknowledgementRequest()); 40 } 41 public AcknowledgementRequestMsg(AcknowledgementRequest item) 42 { 43 super(MsgTypes.m_acknowledge); 44 this.item = item; 45 } 46 47 public AcknowledgementRequest getAck() 48 { 49 return item; 50 } 51 52 public void trimReply() 53 { 54 item = null; 55 } 56 57 public void write(ObjectOutputStream out) throws IOException 58 { 59 super.write(out); 60 int hasItem = item != null ? 1 : 0; 61 out.writeByte(hasItem); 62 if (hasItem == 1) 63 item.writeExternal(out); 64 } 65 public void read(ObjectInputStream in) throws IOException , ClassNotFoundException 66 { 67 super.read(in); 68 int hasItem = in.readByte(); 69 if (hasItem == 1) 70 item.readExternal(in); 71 } 72 } 73 | Popular Tags |