Package org.messaginghub.pooled.jms.util
Class JMSExceptionSupport
java.lang.Object
org.messaginghub.pooled.jms.util.JMSExceptionSupport
Exception support class.
Factory class for creating JMSException instances based on String messages or by
wrapping other non-JMS exception.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.jms.JMSException
Creates or passes through a JMSException to be thrown to the client.static jakarta.jms.JMSException
Creates or passes through a JMSException to be thrown to the client.static jakarta.jms.MessageEOFException
Creates or passes through a MessageEOFException to be thrown to the client.static jakarta.jms.MessageFormatException
Creates or passes through a MessageFormatException to be thrown to the client.static jakarta.jms.ResourceAllocationException
Creates or passes through a ResourceAllocationException to be thrown to the client.static jakarta.jms.JMSRuntimeException
createRuntimeException
(Exception exception) Creates the proper instance of a JMSRuntimeException based on the type of JMSException that is passed.
-
Constructor Details
-
JMSExceptionSupport
public JMSExceptionSupport()
-
-
Method Details
-
create
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
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
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
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.
-
createResourceAllocationException
public static jakarta.jms.ResourceAllocationException createResourceAllocationException(Throwable cause) Creates or passes through a ResourceAllocationException to be thrown to the client. In the event that the exception passed to this method is already a ResourceAllocationException it is passed through unmodified, otherwise a new ResourceAllocationException 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 ResourceAllocationException instance.
-
createRuntimeException
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.
-