public class JmsResourceHolder extends ResourceHolderSupport
Note: This is an SPI class, not intended to be used by applications.
JmsTransactionManager
,
JmsTemplate
Modifier and Type | Field and Description |
---|---|
private ConnectionFactory |
connectionFactory |
private java.util.List<Connection> |
connections |
private boolean |
frozen |
private static Log |
logger |
private java.util.List<Session> |
sessions |
private java.util.Map<Connection,java.util.List<Session>> |
sessionsPerConnection |
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, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unbound
private static final Log logger
private ConnectionFactory connectionFactory
private boolean frozen
private final java.util.List<Connection> connections
private final java.util.List<Session> sessions
private final java.util.Map<Connection,java.util.List<Session>> sessionsPerConnection
public JmsResourceHolder()
addConnection(Connection)
,
addSession(Session)
public JmsResourceHolder(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(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, Connection connection)
public boolean containsSession(Session session)
public Connection getConnection()
public Connection getConnection(java.lang.Class<? extends Connection> connectionType)
public Session getSession()
public Session getSession(java.lang.Class<? extends Session> sessionType)
public Session getSession(java.lang.Class<? extends Session> sessionType, Connection connection)
public void commitAll() throws JMSException
JMSException
public void closeAll()