1 24 package org.objectweb.joram.shared.client; 25 26 import java.io.Externalizable ; 27 import java.io.InputStream ; 28 import java.io.OutputStream ; 29 import java.io.IOException ; 30 import java.util.Vector ; 31 32 import org.objectweb.joram.shared.messages.Message; 33 import org.objectweb.joram.shared.stream.Streamable; 34 import org.objectweb.joram.shared.stream.StreamUtil; 35 36 41 public final class QBrowseReply extends AbstractJmsReply { 42 43 private Vector messages = null; 44 45 46 public Vector getMessages() { 47 if (messages == null) 48 messages = new Vector (); 49 return messages; 50 } 51 52 public void addMessage(Message msg) { 53 if (messages == null) 54 messages = new Vector (); 55 messages.addElement(msg); 56 } 57 58 protected int getClassId() { 59 return QBROWSE_REPLY; 60 } 61 62 65 private QBrowseReply(int correlationId) { 66 super(correlationId); 67 } 68 69 72 private QBrowseReply(int correlationId, Message message) { 73 super(correlationId); 74 messages = new Vector (); 75 messages.addElement(message); 76 } 77 78 81 public QBrowseReply(int correlationId, Vector messages) { 82 super(correlationId); 83 this.messages = messages; 84 } 85 86 89 public QBrowseReply() { 90 } 91 92 95 96 102 public void writeTo(OutputStream os) throws IOException { 103 super.writeTo(os); 104 Message.writeVectorTo(messages, os); 105 } 106 107 113 public void readFrom(InputStream is) throws IOException { 114 super.readFrom(is); 115 messages = Message.readVectorFrom(is); 116 } 117 } 118 | Popular Tags |