public class JmsSessionManager extends Object
Session.
This is used when the InternalAckMode is configured in InternalAckMode.MANUAL| Constructor and Description |
|---|
JmsSessionManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
ack(String ackId,
AckCallback ackCallback)
Executes the
Message.acknowledge() on the latest Message associated to the Session
identified by the ackId |
void |
bindToTransaction(JmsSession session)
Binds the given
JmsSession to the current Thread |
void |
bindToTransaction(org.mule.runtime.extension.api.connectivity.XATransactionalConnection jmsXaTransactionalConnection,
JmsSession session,
JmsXaContext xaResource)
|
void |
changeTransactionStatus(TransactionStatus transactionStatus) |
Optional<JmsXaContext> |
getJmsXaContext(JmsTransactionalConnection xaTransactionalConnection) |
Optional<JmsSession> |
getTransactedSession(JmsConnection connection) |
TransactionStatus |
getTransactionStatus() |
Optional<JmsSession> |
getXaTransactedSession(org.mule.runtime.extension.api.connectivity.XATransactionalConnection jmsXaTransactionalConnection) |
void |
recoverSession(String ackId,
AckCallback ackCallback)
Executes the
Session.recover() over the Session identified by the ackId |
void |
registerMessageForAck(String ackId,
javax.jms.Message message,
javax.jms.Session session,
JmsListenerLock jmsLock)
Registers the
Message to the Session using the ackId in order to being
able later to perform a InternalAckMode.MANUAL ACK |
void |
unbindSession()
Unbinds the current
JmsSession, if there is one, of the current Thread |
void |
unbindSession(org.mule.runtime.extension.api.connectivity.XATransactionalConnection jmsXaTransactionalConnection)
Unbinds the current
JmsSession, if there is one, of the current Thread |
public void registerMessageForAck(String ackId, javax.jms.Message message, javax.jms.Session session, JmsListenerLock jmsLock)
Message to the Session using the ackId in order to being
able later to perform a InternalAckMode.MANUAL ACKackId - the id associated to the Session used to create the Messagemessage - the Message to use for executing the Message.acknowledge()jmsLock - the optional JmsListenerLock to be able to unlock the JmsListenerIllegalArgumentException - if no Session was registered with the given AckIdpublic void ack(String ackId, AckCallback ackCallback)
Message.acknowledge() on the latest Message associated to the Session
identified by the ackIdackId - the id associated to the Session that should be ACKedjavax.jms.JMSException - if an error occurs during the ackpublic void recoverSession(String ackId, AckCallback ackCallback)
Session.recover() over the Session identified by the ackIdackId - the id associated to the Session used to create the Messagejavax.jms.JMSException - if an error occurs during recovering the sessionpublic void bindToTransaction(JmsSession session)
JmsSession to the current Threadsession - session to bindpublic void bindToTransaction(org.mule.runtime.extension.api.connectivity.XATransactionalConnection jmsXaTransactionalConnection,
JmsSession session,
JmsXaContext xaResource)
session - session to bindpublic void unbindSession()
JmsSession, if there is one, of the current Threadpublic void unbindSession(org.mule.runtime.extension.api.connectivity.XATransactionalConnection jmsXaTransactionalConnection)
JmsSession, if there is one, of the current Threadpublic Optional<JmsSession> getTransactedSession(JmsConnection connection)
connection - Optional JmsSession of the current Threadpublic Optional<JmsSession> getXaTransactedSession(org.mule.runtime.extension.api.connectivity.XATransactionalConnection jmsXaTransactionalConnection)
public TransactionStatus getTransactionStatus()
TransactionStatus.NONE means that there is no started transaction for the current Thread
- TransactionStatus.STARTED means that there is a transaction being executed in the current Threadpublic void changeTransactionStatus(TransactionStatus transactionStatus)
transactionStatus - The new TransactionStatuspublic Optional<JmsXaContext> getJmsXaContext(JmsTransactionalConnection xaTransactionalConnection)
Optional JmsXaContext of the current ThreadCopyright © 2019. All rights reserved.