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, org.springframework.jms.core.JmsTemplate
| Modifier and Type | Field and Description |
|---|---|
| private ConnectionFactory | |
| private final Deque | |
| private boolean | |
| private static final Log | |
| private final Deque | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | |
| public | JmsResourceHolder(ConnectionFactory
the JMS ConnectionFactory that this
resource holder is associated with (may be connectionFactory)null)Create a new JmsResourceHolder that is open for resources to be added. |
| public | JmsResourceHolder(Session
the JMS Session session)Create a new JmsResourceHolder for the given JMS Session. |
| public | JmsResourceHolder(Connection
the JMS Connection connection, Session the JMS Session session)Create a new JmsResourceHolder for the given JMS resources. |
| public | JmsResourceHolder(ConnectionFactory
the JMS ConnectionFactory that this
resource holder is associated with (may be connectionFactory, Connection null)the JMS Connection connection, Session the JMS Session session)Create a new JmsResourceHolder for the given JMS resources. |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final void | |
| public final void | addSession(Session session, Connection connection)
Add the given Session to this resource holder, registered for a specific Connection. |
| public void | |
| public void | |
| public boolean | containsSession(Session session)
Determine whether the given Session is registered with this resource holder. |
| public Connection | |
| public <C extends Connection> C | getConnection(Class<C> connectionType)
Return this resource holder's Connection of the given type,
or |
| pack-priv Session | |
| public Session | |
| public <S extends Session> S | getSession(Class<S> sessionType)
Return this resource holder's Session of the given type,
or |
| public <S extends Session> S | getSession(Class<S> sessionType, Connection connection)
Return this resource holder's Session of the given type
for the given connection, or |
| public final boolean | isFrozen()
Return whether this resource holder is frozen, i.e. does not allow for adding further Connections and Sessions to it. |
| connectionFactory | back to summary |
|---|---|
| private ConnectionFactory connectionFactory
| |
| connections | back to summary |
|---|---|
| private final Deque<Connection> connections | |
| frozen | back to summary |
|---|---|
| private boolean frozen | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| sessions | back to summary |
|---|---|
| private final Deque<Session> sessions | |
| sessionsPerConnection | back to summary |
|---|---|
| private final Map<Connection, Deque<Session>> sessionsPerConnection | |
| JmsResourceHolder | back to summary |
|---|---|
| public JmsResourceHolder() Create a new JmsResourceHolder that is open for resources to be added.
| |
| JmsResourceHolder | back to summary |
|---|---|
| public JmsResourceHolder(ConnectionFactory connectionFactory) Create a new JmsResourceHolder that is open for resources to be added.
| |
| JmsResourceHolder | back to summary |
|---|---|
| public JmsResourceHolder(Session session) Create a new JmsResourceHolder for the given JMS Session.
| |
| JmsResourceHolder | back to summary |
|---|---|
| public JmsResourceHolder(Connection connection, Session session) Create a new JmsResourceHolder for the given JMS resources.
| |
| JmsResourceHolder | back to summary |
|---|---|
| public JmsResourceHolder(ConnectionFactory connectionFactory, Connection connection, Session session) Create a new JmsResourceHolder for the given JMS resources.
| |
| addConnection | back to summary |
|---|---|
| public final void addConnection(Connection connection) Add the given Connection to this resource holder. | |
| addSession | back to summary |
|---|---|
| public final void addSession(Session session) Add the given Session to this resource holder. | |
| addSession | back to summary |
|---|---|
| public final void addSession(Session session, Connection connection) Add the given Session to this resource holder, registered for a specific Connection. | |
| closeAll | back to summary |
|---|---|
| public void closeAll() Close all of this resource holder's Sessions and clear its state.
| |
| commitAll | back to summary |
|---|---|
| public void commitAll() throws JMSException Commit all of this resource holder's Sessions.
| |
| containsSession | back to summary |
|---|---|
| public boolean containsSession(Session session) Determine whether the given Session is registered with this resource holder. | |
| getConnection | back to summary |
|---|---|
| public Connection getConnection() Return this resource holder's default Connection,
or
| |
| getConnection | back to summary |
|---|---|
| public <C extends Connection> C getConnection(Class<C> connectionType) Return this resource holder's Connection of the given type,
or
| |
| getOriginalSession | back to summary |
|---|---|
| pack-priv Session getOriginalSession() Return an existing original Session, if any. In contrast to
| |
| getSession | back to summary |
|---|---|
| public Session getSession() Return this resource holder's default Session,
or
| |
| getSession | back to summary |
|---|---|
| public <S extends Session> S getSession(Class<S> sessionType) Return this resource holder's Session of the given type,
or
| |
| getSession | back to summary |
|---|---|
| public <S extends Session> S getSession(Class<S> sessionType, Connection connection) Return this resource holder's Session of the given type
for the given connection, or
| |
| isFrozen | back to summary |
|---|---|
| public final boolean isFrozen() Return whether this resource holder is frozen, i.e. does not allow for adding further Connections and Sessions to it.
| |