|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jms.support.JmsUtils
public 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.
Constructor Summary | |
---|---|
JmsUtils()
|
Method Summary | |
---|---|
static void |
closeConnection(Connection con)
Close the given JMS Connection and ignore any thrown exception. |
static void |
closeMessageConsumer(MessageConsumer consumer)
Close the given JMS MessageConsumer and ignore any thrown exception. |
static void |
closeMessageProducer(MessageProducer producer)
Close the given JMS MessageProducer and ignore any thrown exception. |
static void |
closeSession(Session session)
Close the given JMS Session and ignore any thrown exception. |
static void |
commitIfNecessary(Session session)
Commit the Session if not within a JTA transaction. |
static JmsException |
convertJmsAccessException(JMSException ex)
Convert the specified checked JMSException to
a Spring runtime JmsException
equivalent. |
static void |
rollbackIfNecessary(Session session)
Rollback the Session if not within a JTA transaction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JmsUtils()
Method Detail |
---|
public static void closeConnection(Connection con)
finally
blocks in manual JMS code.
con
- the JMS Connection to close (may be null
)public static void closeSession(Session session)
finally
blocks in manual JMS code.
session
- the JMS Session to close (may be null
)public static void closeMessageProducer(MessageProducer producer)
finally
blocks in manual JMS code.
producer
- the JMS MessageProducer to close (may be null
)public static void closeMessageConsumer(MessageConsumer consumer)
finally
blocks in manual JMS code.
consumer
- the JMS MessageConsumer to close (may be null
)public static void commitIfNecessary(Session session) throws JMSException
session
- the JMS Session to commit
JMSException
- if committing failedpublic static void rollbackIfNecessary(Session session) throws JMSException
session
- the JMS Session to rollback
JMSException
- if committing failedpublic static JmsException convertJmsAccessException(JMSException ex)
JMSException
to
a Spring runtime JmsException
equivalent.
ex
- the original checked JMSException to convert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |