接口 ConnectionFactoryUtils.ResourceFactory
public static interface ConnectionFactoryUtils.ResourceFactory
Callback interface for resource creation. Serving as argument for thedoGetTransactionalSession
method.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 Connection
createConnection()
Create a new JMS Connection for registration with a JmsResourceHolder.Session
createSession(Connection con)
Create a new JMS Session for registration with a JmsResourceHolder.Connection
getConnection(JmsResourceHolder holder)
Fetch an appropriate Connection from the given JmsResourceHolder.Session
getSession(JmsResourceHolder holder)
Fetch an appropriate Session from the given JmsResourceHolder.boolean
isSynchedLocalTransactionAllowed()
Return whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction.
方法详细资料
getSession
Session getSession(JmsResourceHolder holder)
Fetch an appropriate Session from the given JmsResourceHolder.- 参数:
holder
- the JmsResourceHolder- 返回:
- an appropriate Session fetched from the holder, or
null
if none found
getConnection
Connection getConnection(JmsResourceHolder holder)
Fetch an appropriate Connection from the given JmsResourceHolder.- 参数:
holder
- the JmsResourceHolder- 返回:
- an appropriate Connection fetched from the holder, or
null
if none found
createConnection
Connection createConnection() throws JMSException
Create a new JMS Connection for registration with a JmsResourceHolder.- 返回:
- the new JMS Connection
- 抛出:
JMSException
- if thrown by JMS API methods
createSession
Session createSession(Connection con) throws JMSException
Create a new JMS Session for registration with a JmsResourceHolder.- 参数:
con
- the JMS Connection to create a Session for- 返回:
- the new JMS Session
- 抛出:
JMSException
- if thrown by JMS API methods
isSynchedLocalTransactionAllowed
boolean isSynchedLocalTransactionAllowed()
Return whether to allow for a local JMS transaction that is synchronized with a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for example), with the JMS transaction committing right after the main transaction.- 返回:
- whether to allow for synchronizing a local JMS transaction