Package org.apache.qpid.jms.exceptions
Class JmsExceptionSupport
- java.lang.Object
-
- org.apache.qpid.jms.exceptions.JmsExceptionSupport
-
public final class JmsExceptionSupport extends java.lang.ObjectException support class. Factory class for creating JMSException instances based on String messages or by wrapping other non-JMS exception.- Since:
- 1.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static jakarta.jms.JMSExceptioncreate(java.lang.String message, java.lang.Throwable cause)Creates or passes through a JMSException to be thrown to the client.static jakarta.jms.JMSExceptioncreate(java.lang.Throwable cause)Creates or passes through a JMSException to be thrown to the client.static jakarta.jms.MessageEOFExceptioncreateMessageEOFException(java.lang.Throwable cause)Creates or passes through a MessageEOFException to be thrown to the client.static jakarta.jms.MessageFormatExceptioncreateMessageFormatException(java.lang.Throwable cause)Creates or passes through a MessageFormatException to be thrown to the client.static jakarta.jms.JMSRuntimeExceptioncreateRuntimeException(java.lang.Exception exception)Creates the proper instance of a JMSRuntimeException based on the type of JMSException that is passed.
-
-
-
Method Detail
-
create
public static jakarta.jms.JMSException create(java.lang.String message, java.lang.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 jakarta.jms.JMSException create(java.lang.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 jakarta.jms.MessageEOFException createMessageEOFException(java.lang.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 jakarta.jms.MessageFormatException createMessageFormatException(java.lang.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 jakarta.jms.JMSRuntimeException createRuntimeException(java.lang.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
JMSRuntimeExceptioninstance that reflects the original error.
-
-