spring-framework / org.springframework.jms.support / JmsUtils

JmsUtils

abstract class JmsUtils

Generic utility methods for working with JMS. Mainly for internal use within the framework, but also useful for custom JMS access code.

Author
Juergen Hoeller

Since
1.1

Constructors

<init>

JmsUtils()

Generic utility methods for working with JMS. Mainly for internal use within the framework, but also useful for custom JMS access code.

Functions

buildExceptionMessage

open static fun buildExceptionMessage(ex: JMSException): String

Build a descriptive exception message for the given JMSException, incorporating a linked exception's message if appropriate.

closeConnection

open static fun closeConnection(con: Connection): Unit
open static fun closeConnection(con: Connection, stop: Boolean): Unit

Close the given JMS Connection and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

closeMessageConsumer

open static fun closeMessageConsumer(consumer: MessageConsumer): Unit

Close the given JMS MessageConsumer and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

closeMessageProducer

open static fun closeMessageProducer(producer: MessageProducer): Unit

Close the given JMS MessageProducer and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

closeQueueBrowser

open static fun closeQueueBrowser(browser: QueueBrowser): Unit

Close the given JMS QueueBrowser and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

closeQueueRequestor

open static fun closeQueueRequestor(requestor: QueueRequestor): Unit

Close the given JMS QueueRequestor and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

closeSession

open static fun closeSession(session: Session): Unit

Close the given JMS Session and ignore any thrown exception. This is useful for typical finally blocks in manual JMS code.

commitIfNecessary

open static fun commitIfNecessary(session: Session): Unit

Commit the Session if not within a JTA transaction.

convertJmsAccessException

open static fun convertJmsAccessException(ex: JMSException): JmsException

Convert the specified checked javax.jms.JMSException to a Spring runtime org.springframework.jms.JmsException equivalent.

rollbackIfNecessary

open static fun rollbackIfNecessary(session: Session): Unit

Rollback the Session if not within a JTA transaction.