Wow, people are actually looking at the code! I must admit that currently, the MessageStore is somewhat nebulous in my mind. The idea of course is to delegate all message storage to implementations of MessageStore allowing them to store messages as they see fit (in memory, database, file, etc.) not unlike the JBossMQ PersistanceManager. One difference, however, is that it is the MessageStore's job to expire messages as well--this may or may not be a good thing. Anyway, I appreciate your suggestion about Iterator vs. Collection. Frankly, I've seen people use them interchangeable and I've never developed a preference from one over the other. But your point is well taken. I choose to return a list because that is how I was storing the messages in the SimpleMessageStore. A MessageStore that stores messages in a db would be dealing with a different underlying data structure, so your point is well taken. I'll give this some more thought, but I think you are likely right--in fact in a small sort of way using List destroys the abstraction that MessageStore is trying to create...
Thanks, Nathan JMS/JBoss Lead JBoss Group, L.L.C. > -----Original Message----- > From: Michael Barker [mailto:[EMAIL PROTECTED] > Sent: Sunday, July 20, 2003 4:19 AM > To: [EMAIL PROTECTED] > Subject: [JBoss-dev] Suggested interface change for > org.jboss.jms.server.MessageStore > > Hi, > > I am currently looking at the MessageStore part of the new JMS > implementation. I would like to propose the addition of the following > method to MessageStore interface: > > "Iterator getSavedMessagesIterator()" > > The reason being that the MessageStore implementation may not want to > store all of the MessageReferences in memory to improve scalability. > Implementing an Iterator interface to handle this will be a lot simpler > than implementing a List interface. This will also give the caller more > control as to the resource usage by the system (e.g. the caller can load > the messages into a list if it so desires). This should also be the > preferred method for getting at all of the messages in the store, almost > to the point where I would suggest deprecating or removing "List > getSavedMessages()". > > Regards, > Mike. > > -- > Michael Barker <[EMAIL PROTECTED]> > > > > ------------------------------------------------------- > This SF.net email is sponsored by: VM Ware > With VMware you can run multiple operating systems on a single machine. > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the > same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 > _______________________________________________ > JBoss-Development mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-development ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development