public class JmsResourceHolder extends ResourceHolderSupport
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.
JmsTransactionManager
,
JmsTemplate
Constructor and Description |
---|
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.
|
JmsResourceHolder(Session session)
Create a new JmsResourceHolder for the given JMS Session.
|
Modifier and Type | Method and Description |
---|---|
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(java.lang.Class<? extends Connection> connectionType) |
Session |
getSession() |
Session |
getSession(java.lang.Class<? extends Session> sessionType) |
Session |
getSession(java.lang.Class<? extends Session> sessionType,
Connection connection) |
boolean |
isFrozen() |
clear, getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, resetRollbackOnly, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound
public JmsResourceHolder()
public JmsResourceHolder(@Nullable ConnectionFactory connectionFactory)
connectionFactory
- the JMS ConnectionFactory that this
resource holder is associated with (may be null
)public JmsResourceHolder(Session session)
session
- the JMS Sessionpublic JmsResourceHolder(Connection connection, Session session)
connection
- the JMS Connectionsession
- the JMS Sessionpublic JmsResourceHolder(@Nullable ConnectionFactory connectionFactory, Connection connection, Session session)
connectionFactory
- the JMS ConnectionFactory that this
resource holder is associated with (may be null
)connection
- the JMS Connectionsession
- the JMS Sessionpublic final boolean isFrozen()
public final void addConnection(Connection connection)
public final void addSession(Session session)
public final void addSession(Session session, @Nullable Connection connection)
public boolean containsSession(Session session)
@Nullable public Connection getConnection()
@Nullable public Connection getConnection(java.lang.Class<? extends Connection> connectionType)
@Nullable public Session getSession(java.lang.Class<? extends Session> sessionType, @Nullable Connection connection)
public void commitAll() throws JMSException
JMSException
public void closeAll()