01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package javax.jms;
23:
24: /**
25: * <P> This exception must be thrown when a JMS client
26: * attempts to use a data type not supported by a message or attempts to
27: * read data in a message as the wrong type. It must also be thrown when
28: * equivalent type errors are made with message property values. For
29: * example, this exception must be thrown if
30: * <CODE>StreamMessage.writeObject</CODE> is given an unsupported class or
31: * if <CODE>StreamMessage.readShort</CODE> is used to read a
32: * <CODE>boolean</CODE> value. Note that the special case of a failure
33: * caused by an attempt to read improperly formatted <CODE>String</CODE>
34: * data as numeric values must throw the
35: * <CODE>java.lang.NumberFormatException</CODE>.
36: **/
37:
38: public class MessageFormatException extends JMSException {
39: private static final long serialVersionUID = -3642297253594750138L;
40:
41: /** Constructs a <CODE>MessageFormatException</CODE> with the specified
42: * reason and error code.
43: *
44: * @param reason a description of the exception
45: * @param errorCode a string specifying the vendor-specific
46: * error code
47: *
48: **/
49: public MessageFormatException(String reason, String errorCode) {
50: super (reason, errorCode);
51: }
52:
53: /** Constructs a <CODE>MessageFormatException</CODE> with the specified
54: * reason. The error code defaults to null.
55: *
56: * @param reason a description of the exception
57: **/
58: public MessageFormatException(String reason) {
59: super(reason);
60: }
61:
62: }
|