01: /*
02: * @(#)ExceptionListener.java 1.8 02/04/09
03: *
04: * Copyright 1997-2002 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * SUN PROPRIETARY/CONFIDENTIAL.
07: * This software is the proprietary information of Sun Microsystems, Inc.
08: * Use is subject to license terms.
09: *
10: */
11:
12: package javax.jms;
13:
14: /** If a JMS provider detects a serious problem with a <CODE>Connection</CODE>
15: * object, it informs the <CODE>Connection</CODE> object's
16: * <CODE>ExceptionListener</CODE>, if one has been registered.
17: * It does this by calling the listener's <CODE>onException</CODE> method,
18: * passing it a <CODE>JMSException</CODE> argument describing the problem.
19: *
20: * <P>An exception listener allows a client to be notified of a problem
21: * asynchronously. Some connections only consume messages, so they would have no
22: * other way to learn that their connection has failed.
23: *
24: * <P>A JMS provider should attempt to resolve connection problems
25: * itself before it notifies the client of them.
26: *
27: * @version 1.0 - 9 March 1998
28: * @author Mark Hapner
29: * @author Rich Burridge
30: *
31: * @see javax.jms.Connection#setExceptionListener(ExceptionListener)
32: */
33:
34: public interface ExceptionListener {
35:
36: /** Notifies user of a JMS exception.
37: *
38: * @param exception the JMS exception
39: */
40:
41: void onException(JMSException exception);
42: }
|