| java.lang.Object org.springframework.jms.connection.ConnectionFactoryUtils
Inner Class :public interface ResourceFactory | |
Method Summary | |
public static Session | doGetTransactionalSession(ConnectionFactory connectionFactory, ResourceFactory resourceFactory) Obtain a JMS Session that is synchronized with the current transaction, if any. | public static Session | doGetTransactionalSession(ConnectionFactory connectionFactory, ResourceFactory resourceFactory, boolean startConnection) Obtain a JMS Session that is synchronized with the current transaction, if any.
Parameters: connectionFactory - the JMS ConnectionFactory to bind for(used as TransactionSynchronizationManager key) Parameters: resourceFactory - the ResourceFactory to use for extracting or creatingJMS resources Parameters: startConnection - whether the underlying JMS Connection approach should bestarted in order to allow for receiving messages. | public static QueueSession | getTransactionalQueueSession(QueueConnectionFactory cf, QueueConnection existingCon, boolean synchedLocalTransactionAllowed) Obtain a JMS QueueSession that is synchronized with the current transaction, if any.
Mainly intended for use with the JMS 1.0.2 API.
Parameters: cf - the ConnectionFactory to obtain a Session for Parameters: existingCon - the existing JMS Connection to obtain a Session for(may be null ) Parameters: synchedLocalTransactionAllowed - whether to allow for a local JMS transactionthat is synchronized with a Spring-managed transaction (where the main transactionmight be a JDBC-based one for a specific DataSource, for example), with the JMStransaction committing right after the main transaction. | public static Session | getTransactionalSession(ConnectionFactory cf, Connection existingCon, boolean synchedLocalTransactionAllowed) Obtain a JMS Session that is synchronized with the current transaction, if any.
Parameters: cf - the ConnectionFactory to obtain a Session for Parameters: existingCon - the existing JMS Connection to obtain a Session for(may be null ) Parameters: synchedLocalTransactionAllowed - whether to allow for a local JMS transactionthat is synchronized with a Spring-managed transaction (where the main transactionmight be a JDBC-based one for a specific DataSource, for example), with the JMStransaction committing right after the main transaction. | public static TopicSession | getTransactionalTopicSession(TopicConnectionFactory cf, TopicConnection existingCon, boolean synchedLocalTransactionAllowed) Obtain a JMS TopicSession that is synchronized with the current transaction, if any.
Mainly intended for use with the JMS 1.0.2 API.
Parameters: cf - the ConnectionFactory to obtain a Session for Parameters: existingCon - the existing JMS Connection to obtain a Session for(may be null ) Parameters: synchedLocalTransactionAllowed - whether to allow for a local JMS transactionthat is synchronized with a Spring-managed transaction (where the main transactionmight be a JDBC-based one for a specific DataSource, for example), with the JMStransaction committing right after the main transaction. | public static boolean | isSessionTransactional(Session session, ConnectionFactory cf) Determine whether the given JMS Session is transactional, that is,
bound to the current thread by Spring's transaction facilities. | public static void | releaseConnection(Connection con, ConnectionFactory cf, boolean started) Release the given Connection, stopping it (if necessary) and eventually closing it. |
doGetTransactionalSession | public static Session doGetTransactionalSession(ConnectionFactory connectionFactory, ResourceFactory resourceFactory) throws JMSException(Code) | | Obtain a JMS Session that is synchronized with the current transaction, if any.
This doGetTransactionalSession variant always starts the underlying
JMS Connection, assuming that the Session will be used for receiving messages.
Parameters: connectionFactory - the JMS ConnectionFactory to bind for(used as TransactionSynchronizationManager key) Parameters: resourceFactory - the ResourceFactory to use for extracting or creatingJMS resources the transactional Session, or null if none found throws: JMSException - in case of JMS failure See Also: ConnectionFactoryUtils.doGetTransactionalSession(javax.jms.ConnectionFactory,ResourceFactory,boolean) |
doGetTransactionalSession | public static Session doGetTransactionalSession(ConnectionFactory connectionFactory, ResourceFactory resourceFactory, boolean startConnection) throws JMSException(Code) | | Obtain a JMS Session that is synchronized with the current transaction, if any.
Parameters: connectionFactory - the JMS ConnectionFactory to bind for(used as TransactionSynchronizationManager key) Parameters: resourceFactory - the ResourceFactory to use for extracting or creatingJMS resources Parameters: startConnection - whether the underlying JMS Connection approach should bestarted in order to allow for receiving messages. Note that a reused Connectionmay already have been started before, even if this flag is false . the transactional Session, or null if none found throws: JMSException - in case of JMS failure |
getTransactionalQueueSession | public static QueueSession getTransactionalQueueSession(QueueConnectionFactory cf, QueueConnection existingCon, boolean synchedLocalTransactionAllowed) throws JMSException(Code) | | Obtain a JMS QueueSession that is synchronized with the current transaction, if any.
Mainly intended for use with the JMS 1.0.2 API.
Parameters: cf - the ConnectionFactory to obtain a Session for Parameters: existingCon - the existing JMS Connection to obtain a Session for(may be null ) Parameters: synchedLocalTransactionAllowed - whether to allow for a local JMS transactionthat is synchronized with a Spring-managed transaction (where the main transactionmight be a JDBC-based one for a specific DataSource, for example), with the JMStransaction committing right after the main transaction. If not allowed, the givenConnectionFactory needs to handle transaction enlistment underneath the covers. the transactional Session, or null if none found throws: JMSException - in case of JMS failure |
getTransactionalSession | public static Session getTransactionalSession(ConnectionFactory cf, Connection existingCon, boolean synchedLocalTransactionAllowed) throws JMSException(Code) | | Obtain a JMS Session that is synchronized with the current transaction, if any.
Parameters: cf - the ConnectionFactory to obtain a Session for Parameters: existingCon - the existing JMS Connection to obtain a Session for(may be null ) Parameters: synchedLocalTransactionAllowed - whether to allow for a local JMS transactionthat is synchronized with a Spring-managed transaction (where the main transactionmight be a JDBC-based one for a specific DataSource, for example), with the JMStransaction committing right after the main transaction. If not allowed, the givenConnectionFactory needs to handle transaction enlistment underneath the covers. the transactional Session, or null if none found throws: JMSException - in case of JMS failure |
getTransactionalTopicSession | public static TopicSession getTransactionalTopicSession(TopicConnectionFactory cf, TopicConnection existingCon, boolean synchedLocalTransactionAllowed) throws JMSException(Code) | | Obtain a JMS TopicSession that is synchronized with the current transaction, if any.
Mainly intended for use with the JMS 1.0.2 API.
Parameters: cf - the ConnectionFactory to obtain a Session for Parameters: existingCon - the existing JMS Connection to obtain a Session for(may be null ) Parameters: synchedLocalTransactionAllowed - whether to allow for a local JMS transactionthat is synchronized with a Spring-managed transaction (where the main transactionmight be a JDBC-based one for a specific DataSource, for example), with the JMStransaction committing right after the main transaction. If not allowed, the givenConnectionFactory needs to handle transaction enlistment underneath the covers. the transactional Session, or null if none found throws: JMSException - in case of JMS failure |
isSessionTransactional | public static boolean isSessionTransactional(Session session, ConnectionFactory cf)(Code) | | Determine whether the given JMS Session is transactional, that is,
bound to the current thread by Spring's transaction facilities.
Parameters: session - the JMS Session to check Parameters: cf - the JMS ConnectionFactory that the Session originated from whether the Session is transactional |
|
|