站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.0.5 API 文档英文版

JmsResourceHolder (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版

The Spring Framework

org.springframework.jms.connection
Class JmsResourceHolder

java.lang.Object
  extended by org.springframework.transaction.support.ResourceHolderSupport
      extended by org.springframework.jms.connection.JmsResourceHolder

public class JmsResourceHolder
extends ResourceHolderSupport

Connection holder, wrapping a JMS Connection and a JMS Session. JmsTransactionManager binds instances of this class to the thread, for a given JMS ConnectionFactory.

Note: This is an SPI class, not intended to be used by applications.

Since:
1.1
Author:
Juergen Hoeller
See Also:
JmsTransactionManager, JmsTemplate

Constructor Summary
JmsResourceHolder()
          Create a new JmsResourceHolder that is open for resources to be added.
JmsResourceHolder(ConnectionFactory connectionFactory)
          Create a new JmsResourceHolder that is open for resources to be added.
JmsResourceHolder(ConnectionFactory connectionFactory, Connection connection, Session session)
          Create a new JmsResourceHolder for the given JMS resources.
JmsResourceHolder(Connection connection, Session session)
          Create a new JmsResourceHolder for the given JMS resources.
 
Method Summary
 void addConnection(Connection connection)
           
 void addSession(Session session)
           
 void addSession(Session session, Connection connection)
           
 void closeAll()
           
 void commitAll()
           
 boolean containsSession(Session session)
           
 Connection getConnection()
           
 Connection getConnection(Class connectionType)
           
 Session getSession()
           
 Session getSession(Class sessionType)
           
 Session getSession(Class sessionType, Connection connection)
           
 boolean isFrozen()
           
 
Methods inherited from class org.springframework.transaction.support.ResourceHolderSupport
clear, getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, released, requested, reset, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsResourceHolder

public JmsResourceHolder()
Create a new JmsResourceHolder that is open for resources to be added.

See Also:
addConnection(javax.jms.Connection), addSession(javax.jms.Session)

JmsResourceHolder

public JmsResourceHolder(ConnectionFactory connectionFactory)
Create a new JmsResourceHolder that is open for resources to be added.

Parameters:
connectionFactory - the JMS ConnectionFactory that this resource holder is associated with (may be null)

JmsResourceHolder

public JmsResourceHolder(Connection connection,
                         Session session)
Create a new JmsResourceHolder for the given JMS resources.

Parameters:
connection - the JMS Connection
session - the JMS Session

JmsResourceHolder

public JmsResourceHolder(ConnectionFactory connectionFactory,
                         Connection connection,
                         Session session)
Create a new JmsResourceHolder for the given JMS resources.

Parameters:
connectionFactory - the JMS ConnectionFactory that this resource holder is associated with (may be null)
connection - the JMS Connection
session - the JMS Session
Method Detail

isFrozen

public final boolean isFrozen()

addConnection

public final void addConnection(Connection connection)

addSession

public final void addSession(Session session)

addSession

public final void addSession(Session session,
                             Connection connection)

containsSession

public boolean containsSession(Session session)

getConnection

public Connection getConnection()

getConnection

public Connection getConnection(Class connectionType)

getSession

public Session getSession()

getSession

public Session getSession(Class sessionType)

getSession

public Session getSession(Class sessionType,
                          Connection connection)

commitAll

public void commitAll()
               throws JMSException
Throws:
JMSException

closeAll

public void closeAll()

The Spring Framework

Copyright © 2002-2007 The Spring Framework.