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. /**
  7. * <P> This exception must be thrown when a JMS client
  8. * attempts to use a data type not supported by a message or attempts to
  9. * read data in a message as the wrong type. It must also be thrown when
  10. * equivalent type errors are made with message property values. For
  11. * example, this exception must be thrown if
  12. * <CODE>StreamMessage.writeObject</CODE> is given an unsupported class or
  13. * if <CODE>StreamMessage.readShort</CODE> is used to read a
  14. * <CODE>boolean</CODE> value. Note that the special case of a failure
  15. * caused by an attempt to read improperly formatted <CODE>String</CODE>
  16. * data as numeric values must throw the
  17. * <CODE>java.lang.NumberFormatException</CODE>.
  18. *
  19. * @version 26 August 1998
  20. * @author Rahul Sharma
  21. **/
  22. public class MessageFormatException extends JMSException {
  23. /** Constructs a <CODE>MessageFormatException</CODE> with the specified
  24. * reason and error code.
  25. *
  26. * @param reason a description of the exception
  27. * @param errorCode a string specifying the vendor-specific
  28. * error code
  29. *
  30. **/
  31. public
  32. MessageFormatException(String reason, String errorCode) {
  33. super(reason, errorCode);
  34. }
  35. /** Constructs a <CODE>MessageFormatException</CODE> with the specified
  36. * reason. The error code defaults to null.
  37. *
  38. * @param reason a description of the exception
  39. **/
  40. public
  41. MessageFormatException(String reason) {
  42. super(reason);
  43. }
  44. }