Class JmsExceptionSupport


  • public final class JmsExceptionSupport
    extends Object
    Exception support class. Factory class for creating JMSException instances based on String messages or by wrapping other non-JMS exception.
    Since:
    1.0
    • Method Detail

      • create

        public static javax.jms.JMSException create​(String message,
                                                    Throwable cause)
        Creates or passes through a JMSException to be thrown to the client. In the event that the exception passed to this method is already a JMSException it is passed through unmodified, otherwise a new JMSException is created with the given message and the cause is set to the given cause Throwable instance.
        Parameters:
        message - The message value to set when a new JMSException is created.
        cause - The exception that caused this error state.
        Returns:
        a JMSException instance.
      • create

        public static javax.jms.JMSException create​(Throwable cause)
        Creates or passes through a JMSException to be thrown to the client. In the event that the exception passed to this method is already a JMSException it is passed through unmodified, otherwise a new JMSException is created using the error message taken from the given Throwable value and the cause value is set to the given Throwable instance.
        Parameters:
        cause - The exception that caused this error state.
        Returns:
        a JMSException instance.
      • createMessageEOFException

        public static javax.jms.MessageEOFException createMessageEOFException​(Throwable cause)
        Creates or passes through a MessageEOFException to be thrown to the client. In the event that the exception passed to this method is already a MessageEOFException it is passed through unmodified, otherwise a new MessageEOFException is created using the error message taken from the given Throwable value and the cause value is set to the given Throwable instance.
        Parameters:
        cause - The exception that caused this error state.
        Returns:
        a MessageEOFException instance.
      • createMessageFormatException

        public static javax.jms.MessageFormatException createMessageFormatException​(Throwable cause)
        Creates or passes through a MessageFormatException to be thrown to the client. In the event that the exception passed to this method is already a MessageFormatException it is passed through unmodified, otherwise a new MessageFormatException is created using the error message taken from the given Throwable value and the cause value is set to the given Throwable instance.
        Parameters:
        cause - The exception that caused this error state.
        Returns:
        a MessageEOFException instance.
      • createRuntimeException

        public static javax.jms.JMSRuntimeException createRuntimeException​(Exception exception)
        Creates the proper instance of a JMSRuntimeException based on the type of JMSException that is passed.
        Parameters:
        exception - The JMSException instance to convert to a JMSRuntimeException
        Returns:
        a new JMSRuntimeException instance that reflects the original error.