org.springframework.jms.core
Class JmsTemplate.JmsTemplateResourceFactory

java.lang.Object
  extended by org.springframework.jms.core.JmsTemplate.JmsTemplateResourceFactory
All Implemented Interfaces:
ConnectionFactoryUtils.ResourceFactory
Enclosing class:
JmsTemplate

private class JmsTemplate.JmsTemplateResourceFactory
extends java.lang.Object
implements ConnectionFactoryUtils.ResourceFactory

ResourceFactory implementation that delegates to this template's protected callback methods.


Constructor Summary
private JmsTemplate.JmsTemplateResourceFactory()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsTemplate.JmsTemplateResourceFactory

private JmsTemplate.JmsTemplateResourceFactory()
Method Detail

getConnection

public Connection getConnection(JmsResourceHolder holder)
Description copied from interface: ConnectionFactoryUtils.ResourceFactory
Fetch an appropriate Connection from the given JmsResourceHolder.

Specified by:
getConnection in interface ConnectionFactoryUtils.ResourceFactory
Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Connection fetched from the holder, or null if none found

getSession

public Session getSession(JmsResourceHolder holder)
Description copied from interface: ConnectionFactoryUtils.ResourceFactory
Fetch an appropriate Session from the given JmsResourceHolder.

Specified by:
getSession in interface ConnectionFactoryUtils.ResourceFactory
Parameters:
holder - the JmsResourceHolder
Returns:
an appropriate Session fetched from the holder, or null if none found

createConnection

public Connection createConnection()
                            throws JMSException
Description copied from interface: ConnectionFactoryUtils.ResourceFactory
Create a new JMS Connection for registration with a JmsResourceHolder.

Specified by:
createConnection in interface ConnectionFactoryUtils.ResourceFactory
Returns:
the new JMS Connection
Throws:
JMSException - if thrown by JMS API methods

createSession

public Session createSession(Connection con)
                      throws JMSException
Description copied from interface: ConnectionFactoryUtils.ResourceFactory
Create a new JMS Session for registration with a JmsResourceHolder.

Specified by:
createSession in interface ConnectionFactoryUtils.ResourceFactory
Parameters:
con - the JMS Connection to create a Session for
Returns:
the new JMS Session
Throws:
JMSException - if thrown by JMS API methods

isSynchedLocalTransactionAllowed

public boolean isSynchedLocalTransactionAllowed()
Description copied from interface: ConnectionFactoryUtils.ResourceFactory
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.

Specified by:
isSynchedLocalTransactionAllowed in interface ConnectionFactoryUtils.ResourceFactory
Returns:
whether to allow for synchronizing a local JMS transaction