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.DurableSubscriptionID; 28 29 33 public class DeleteSubscriptionMsg extends BaseMsg 34 { 35 private DurableSubscriptionID id; 36 37 public DeleteSubscriptionMsg() 38 { 39 this(null); 40 } 41 public DeleteSubscriptionMsg(DurableSubscriptionID id) 42 { 43 super(MsgTypes.m_destroySubscription); 44 this.id = id; 45 } 46 47 public DurableSubscriptionID getSubscriptionID() 48 { 49 return id; 50 } 51 52 public void trimReply() 53 { 54 id = null; 55 } 56 57 public void write(ObjectOutputStream out) throws IOException 58 { 59 super.write(out); 60 int hasId = id != null ? 1 : 0; 61 out.writeByte(hasId); 62 if (hasId == 1) 63 out.writeObject(id); 64 } 65 public void read(ObjectInputStream in) throws IOException , ClassNotFoundException 66 { 67 super.read(in); 68 int hasId = in.readByte(); 69 if (hasId == 1) 70 id = (DurableSubscriptionID) in.readObject(); 71 } 72 } 73 | Popular Tags |