KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > jms > ExceptionListener


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24
25 package javax.jms;
26
27
28 /** If a JMS provider detects a serious problem with a <CODE>Connection</CODE>
29   * object, it informs the <CODE>Connection</CODE> object's
30   * <CODE>ExceptionListener</CODE>, if one has been registered.
31   * It does this by calling the listener's <CODE>onException</CODE> method,
32   * passing it a <CODE>JMSException</CODE> argument describing the problem.
33   *
34   * <P>An exception listener allows a client to be notified of a problem
35   * asynchronously. Some connections only consume messages, so they would have no
36   * other way to learn that their connection has failed.
37   *
38   * <P>A JMS provider should attempt to resolve connection problems
39   * itself before it notifies the client of them.
40   *
41   * @version 1.0 - 9 March 1998
42   * @author Mark Hapner
43   * @author Rich Burridge
44   *
45   * @see javax.jms.Connection#setExceptionListener(ExceptionListener)
46   */

47
48 public interface ExceptionListener {
49
50     /** Notifies user of a JMS exception.
51       *
52       * @param exception the JMS exception
53       */

54
55     void
56     onException(JMSException JavaDoc exception);
57 }
58
Popular Tags