public static interface

ConnectionFactoryUtils.ResourceFactory

org.springframework.jms.connection.ConnectionFactoryUtils.ResourceFactory

Class Overview

Callback interface for resource creation. Serving as argument for the doGetTransactionalSession method.

Summary

Public Methods
abstract Connection createConnection()
Create a new JMS Connection for registration with a JmsResourceHolder.
abstract Session createSession(Connection con)
Create a new JMS Session for registration with a JmsResourceHolder.
abstract Connection getConnection(JmsResourceHolder holder)
Fetch an appropriate Connection from the given JmsResourceHolder.
abstract Session getSession(JmsResourceHolder holder)
Fetch an appropriate Session from the given JmsResourceHolder.
abstract 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.

Public Methods

public abstract Connection createConnection ()

Create a new JMS Connection for registration with a JmsResourceHolder.

Returns
  • the new JMS Connection
Throws
if thrown by JMS API methods
JMSException

public abstract Session createSession (Connection con)

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
if thrown by JMS API methods
JMSException

public abstract Connection getConnection (JmsResourceHolder holder)

Fetch an appropriate Connection from the given JmsResourceHolder.

Parameters
holder the JmsResourceHolder
Returns
  • an appropriate Connection fetched from the holder, or null if none found

public abstract Session getSession (JmsResourceHolder holder)

Fetch an appropriate Session from the given JmsResourceHolder.

Parameters
holder the JmsResourceHolder
Returns
  • an appropriate Session fetched from the holder, or null if none found

public abstract 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