public interface JmsTransactionContext
Modifier and Type | Method and Description |
---|---|
void |
acknowledge(JmsConnection connection,
JmsInboundMessageDispatch envelope,
ProviderConstants.ACK_TYPE ackType)
Allows the context to intercept a message acknowledgement and perform any
additional logic prior to the acknowledge being forwarded onto the connection.
|
void |
addSynchronization(JmsTransactionSynchronization sync)
Adds the given Transaction synchronization to the current list.
|
void |
begin()
Start a transaction if none is currently active.
|
void |
commit()
Commits all work done in this transaction and releases any locks
currently held.
|
JmsTransactionListener |
getListener() |
JmsTransactionId |
getTransactionId() |
boolean |
isActiveInThisContext(JmsResourceId resouceId)
Allows a resource to query the transaction context to determine if it has pending
work in the current transaction.
|
boolean |
isInDoubt() |
boolean |
isInTransaction() |
void |
onConnectionInterrupted()
Signals that the connection that was previously established has been lost and the
listener should alter its state to reflect the fact that there is no active connection.
|
void |
onConnectionRecovery(Provider provider)
Called when the connection to the remote peer has been lost and then a new
connection established.
|
void |
rollback()
Rolls back any work done in this transaction and releases any locks
currently held.
|
void |
send(JmsConnection connection,
JmsOutboundMessageDispatch envelope)
Allows the context to intercept and perform any additional logic
prior to a message being sent on to the connection and subsequently
the remote peer.
|
void |
setListener(JmsTransactionListener listener)
Sets the single JMS Transaction listener which will be notified of significant TX events
such as Commit or Rollback.
|
void |
shutdown()
Rolls back any work done in this transaction and releases any locks
currently held.
|
void acknowledge(JmsConnection connection, JmsInboundMessageDispatch envelope, ProviderConstants.ACK_TYPE ackType) throws javax.jms.JMSException
connection
- the connection that the acknowledge will be forwarded to.envelope
- the envelope that contains the message to be acknowledged.ackType
- the acknowledgement type being requested.javax.jms.JMSException
- if an error occurs while performing the acknowledge.void send(JmsConnection connection, JmsOutboundMessageDispatch envelope) throws javax.jms.JMSException
connection
- the connection that will be do the send of the messageenvelope
- the envelope that contains the message to be sent.javax.jms.JMSException
- if an error occurs during the send.void addSynchronization(JmsTransactionSynchronization sync) throws javax.jms.JMSException
sync
- the transaction synchronization to add.javax.jms.JMSException
- if an error occurs during the send.boolean isInDoubt()
void begin() throws javax.jms.JMSException
javax.jms.JMSException
- on internal error occurs.void rollback() throws javax.jms.JMSException
javax.jms.JMSException
- if the JMS provider fails to roll back the transaction due to some internal error.void commit() throws javax.jms.JMSException
javax.jms.JMSException
- if the commit fails to roll back the transaction due to some internal error.void shutdown() throws javax.jms.JMSException
javax.jms.JMSException
- if the JMS provider fails to roll back the transaction due to some internal error.JmsTransactionId getTransactionId()
JmsTransactionListener getListener()
void setListener(JmsTransactionListener listener)
listener
- the JMS Transaction listener that will be sent all TX event notifications.boolean isInTransaction()
boolean isActiveInThisContext(JmsResourceId resouceId)
resouceId
- The JmsResourceId of the resource making this query.void onConnectionInterrupted()
void onConnectionRecovery(Provider provider) throws Exception
provider
- A reference to the provider that manages the new connection.Exception
- if an error occurs while rebuilding against the new provider.Copyright © 2013–2016 The Apache Software Foundation. All rights reserved.