1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.jms;
  6. /** A client uses a <CODE>QueueReceiver</CODE> object to receive messages that
  7. * have been delivered to a queue.
  8. *
  9. * <P>Although it is possible to have multiple <CODE>QueueReceiver</CODE>s
  10. * for the same queue, the JMS API does not define how messages are
  11. * distributed between the <CODE>QueueReceiver</CODE>s.
  12. *
  13. * <P>If a <CODE>QueueReceiver</CODE> specifies a message selector, the
  14. * messages that are not selected remain on the queue. By definition, a message
  15. * selector allows a <CODE>QueueReceiver</CODE> to skip messages. This
  16. * means that when the skipped messages are eventually read, the total ordering
  17. * of the reads does not retain the partial order defined by each message
  18. * producer. Only <CODE>QueueReceiver</CODE>s without a message selector
  19. * will read messages in message producer order.
  20. *
  21. * @version 1.0 - 9 March 1998
  22. * @author Mark Hapner
  23. * @author Rich Burridge
  24. *
  25. * @see javax.jms.QueueSession#createReceiver(Queue, String)
  26. * @see javax.jms.QueueSession#createReceiver(Queue)
  27. * @see javax.jms.MessageConsumer
  28. */
  29. public interface QueueReceiver extends MessageConsumer {
  30. /** Gets the <CODE>Queue</CODE> associated with this queue receiver.
  31. *
  32. * @return this receiver's <CODE>Queue</CODE>
  33. *
  34. * @exception JMSException if the JMS provider fails to get the queue for
  35. * this queue receiver
  36. * due to some internal error.
  37. */
  38. Queue
  39. getQueue() throws JMSException;
  40. }