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. /** If a JMS provider detects a serious problem with a <CODE>Connection</CODE>
  7. * object, it informs the <CODE>Connection</CODE> object's
  8. * <CODE>ExceptionListener</CODE>, if one has been registered.
  9. * It does this by calling the listener's <CODE>onException</CODE> method,
  10. * passing it a <CODE>JMSException</CODE> argument describing the problem.
  11. *
  12. * <P>An exception listener allows a client to be notified of a problem
  13. * asynchronously. Some connections only consume messages, so they would have no
  14. * other way to learn that their connection has failed.
  15. *
  16. * <P>A JMS provider should attempt to resolve connection problems
  17. * itself before it notifies the client of them.
  18. *
  19. * @version 1.0 - 9 March 1998
  20. * @author Mark Hapner
  21. * @author Rich Burridge
  22. *
  23. * @see javax.jms.Connection#setExceptionListener(ExceptionListener)
  24. */
  25. public interface ExceptionListener {
  26. /** Notifies user of a JMS exception.
  27. *
  28. * @param exception the JMS exception
  29. */
  30. void
  31. onException(JMSException exception);
  32. }