1 24 package org.objectweb.joram.mom.notifications; 25 26 import org.objectweb.joram.shared.messages.Message; 27 28 import java.util.Vector ; 29 30 34 public class BrowseReply extends AbstractReply { 35 36 private Message message = null; 37 38 private Vector messages = null; 39 40 45 public BrowseReply(BrowseRequest req) { 46 super(req.getClientContext(), req.getRequestId()); 47 } 48 49 50 51 public void addMessage(Message msg) { 52 if (message == null && messages == null) 53 message = msg; 54 else { 55 if (messages == null) { 56 messages = new Vector (); 57 messages.add(message); 58 message = null; 59 } 60 messages.add(msg); 61 } 62 } 63 64 65 public Vector getMessages() { 66 if (message != null) { 67 Vector vec = new Vector (); 68 vec.add(message); 69 return vec; 70 } 71 return messages; 72 } 73 } 74 | Popular Tags |