KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > jms > MessageFormatException


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  * <P> This exception must be thrown when a JMS client
29  * attempts to use a data type not supported by a message or attempts to
30  * read data in a message as the wrong type. It must also be thrown when
31  * equivalent type errors are made with message property values. For
32  * example, this exception must be thrown if
33  * <CODE>StreamMessage.writeObject</CODE> is given an unsupported class or
34  * if <CODE>StreamMessage.readShort</CODE> is used to read a
35  * <CODE>boolean</CODE> value. Note that the special case of a failure
36  * caused by an attempt to read improperly formatted <CODE>String</CODE>
37  * data as numeric values must throw the
38  * <CODE>java.lang.NumberFormatException</CODE>.
39  *
40  * @version 26 August 1998
41  * @author Rahul Sharma
42  **/

43
44 public class MessageFormatException extends JMSException JavaDoc {
45
46   /** Constructs a <CODE>MessageFormatException</CODE> with the specified
47    * reason and error code.
48    *
49    * @param reason a description of the exception
50    * @param errorCode a string specifying the vendor-specific
51    * error code
52    *
53    **/

54   public
55   MessageFormatException(String JavaDoc reason, String JavaDoc errorCode) {
56     super(reason, errorCode);
57   }
58
59   /** Constructs a <CODE>MessageFormatException</CODE> with the specified
60    * reason. The error code defaults to null.
61    *
62    * @param reason a description of the exception
63    **/

64   public
65   MessageFormatException(String JavaDoc reason) {
66     super(reason);
67   }
68
69 }
70
Popular Tags