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 <CODE>MessageListener</CODE> object is used to receive asynchronously
  7. * delivered messages.
  8. *
  9. * <P>Each session must insure that it passes messages serially to the
  10. * listener. This means that a listener assigned to one or more consumers
  11. * of the same session can assume that the <CODE>onMessage</CODE> method
  12. * is not called with the next message until the session has completed the
  13. * last call.
  14. *
  15. * @version 1.0 - 13 March 1998
  16. * @author Mark Hapner
  17. * @author Rich Burridge
  18. */
  19. public interface MessageListener {
  20. /** Passes a message to the listener.
  21. *
  22. * @param message the message passed to the listener
  23. */
  24. void
  25. onMessage(Message message);
  26. }