public class JmsNoTxTransactionContext extends Object implements JmsTransactionContext
Constructor and Description |
---|
JmsNoTxTransactionContext() |
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.
|
public void send(JmsConnection connection, JmsOutboundMessageDispatch envelope) throws javax.jms.JMSException
JmsTransactionContext
send
in interface JmsTransactionContext
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.public void acknowledge(JmsConnection connection, JmsInboundMessageDispatch envelope, ProviderConstants.ACK_TYPE ackType) throws javax.jms.JMSException
JmsTransactionContext
acknowledge
in interface JmsTransactionContext
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.public void addSynchronization(JmsTransactionSynchronization sync) throws javax.jms.JMSException
JmsTransactionContext
addSynchronization
in interface JmsTransactionContext
sync
- the transaction synchronization to add.javax.jms.JMSException
- if an error occurs during the send.public boolean isInDoubt()
isInDoubt
in interface JmsTransactionContext
public void begin() throws javax.jms.JMSException
JmsTransactionContext
begin
in interface JmsTransactionContext
javax.jms.JMSException
- on internal error occurs.public void rollback() throws javax.jms.JMSException
JmsTransactionContext
rollback
in interface JmsTransactionContext
javax.jms.JMSException
- if the JMS provider fails to roll back the transaction due to some internal error.public void shutdown() throws javax.jms.JMSException
JmsTransactionContext
shutdown
in interface JmsTransactionContext
javax.jms.JMSException
- if the JMS provider fails to roll back the transaction due to some internal error.public void commit() throws javax.jms.JMSException
JmsTransactionContext
commit
in interface JmsTransactionContext
javax.jms.JMSException
- if the commit fails to roll back the transaction due to some internal error.public JmsTransactionId getTransactionId()
getTransactionId
in interface JmsTransactionContext
public JmsTransactionListener getListener()
getListener
in interface JmsTransactionContext
public void setListener(JmsTransactionListener listener)
JmsTransactionContext
setListener
in interface JmsTransactionContext
listener
- the JMS Transaction listener that will be sent all TX event notifications.public boolean isInTransaction()
isInTransaction
in interface JmsTransactionContext
public boolean isActiveInThisContext(JmsResourceId resouceId)
JmsTransactionContext
isActiveInThisContext
in interface JmsTransactionContext
resouceId
- The JmsResourceId of the resource making this query.public void onConnectionInterrupted()
JmsTransactionContext
onConnectionInterrupted
in interface JmsTransactionContext
public void onConnectionRecovery(Provider provider) throws Exception
JmsTransactionContext
onConnectionRecovery
in interface JmsTransactionContext
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.