Interface ConnectionFactoryUtils.ResourceFactory
- Enclosing class:
 ConnectionFactoryUtils
public static interface ConnectionFactoryUtils.ResourceFactory
Callback interface for resource creation.
Serving as argument for the 
doGetTransactionalSession method.- Since:
 - 2.0
 - Author:
 - Juergen Hoeller
 
- 
Method Summary
Modifier and TypeMethodDescriptionjakarta.jms.ConnectionCreate a new JMS Connection for registration with a JmsResourceHolder.jakarta.jms.SessioncreateSession(jakarta.jms.Connection con) Create a new JMS Session for registration with a JmsResourceHolder.@Nullable jakarta.jms.ConnectiongetConnection(JmsResourceHolder holder) Fetch an appropriate Connection from the given JmsResourceHolder.@Nullable jakarta.jms.SessiongetSession(JmsResourceHolder holder) Fetch an appropriate Session from the given JmsResourceHolder.booleanReturn 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. 
- 
Method Details
- 
getSession
Fetch an appropriate Session from the given JmsResourceHolder.- Parameters:
 holder- the JmsResourceHolder- Returns:
 - an appropriate Session fetched from the holder,
or 
nullif none found 
 - 
getConnection
Fetch an appropriate Connection from the given JmsResourceHolder.- Parameters:
 holder- the JmsResourceHolder- Returns:
 - an appropriate Connection fetched from the holder,
or 
nullif none found 
 - 
createConnection
jakarta.jms.Connection createConnection() throws jakarta.jms.JMSExceptionCreate a new JMS Connection for registration with a JmsResourceHolder.- Returns:
 - the new JMS Connection
 - Throws:
 jakarta.jms.JMSException- if thrown by JMS API methods
 - 
createSession
jakarta.jms.Session createSession(jakarta.jms.Connection con) throws jakarta.jms.JMSException Create a new JMS Session for registration with a JmsResourceHolder.- Parameters:
 con- the JMS Connection to create a Session for- Returns:
 - the new JMS Session
 - Throws:
 jakarta.jms.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.- Returns:
 - whether to allow for synchronizing a local JMS transaction
 
 
 -