Package org.messaginghub.pooled.jms.util
Class JMSExceptionSupport
- java.lang.Object
-
- org.messaginghub.pooled.jms.util.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.
-
-
Constructor Summary
Constructors Constructor Description JMSExceptionSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.jms.JMSExceptioncreate(String message, Throwable cause)Creates or passes through a JMSException to be thrown to the client.static javax.jms.JMSExceptioncreate(Throwable cause)Creates or passes through a JMSException to be thrown to the client.static javax.jms.MessageEOFExceptioncreateMessageEOFException(Throwable cause)Creates or passes through a MessageEOFException to be thrown to the client.static javax.jms.MessageFormatExceptioncreateMessageFormatException(Throwable cause)Creates or passes through a MessageFormatException to be thrown to the client.static javax.jms.JMSRuntimeExceptioncreateRuntimeException(Exception exception)Creates the proper instance of a JMSRuntimeException based on the type of JMSException that is passed.
-
-
-
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
JMSRuntimeExceptioninstance that reflects the original error.
-
-