public class JmsLocalTransactionContext extends Object implements JmsTransactionContext
| Constructor and Description |
|---|
JmsLocalTransactionContext(JmsSession session) |
| 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 |
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,
ProviderSynchronization outcome)
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.
|
String |
toString() |
public JmsLocalTransactionContext(JmsSession session)
public void send(JmsConnection connection, JmsOutboundMessageDispatch envelope, ProviderSynchronization outcome) throws javax.jms.JMSException
JmsTransactionContextsend in interface JmsTransactionContextconnection - the connection that will be do the send of the messageenvelope - the envelope that contains the message to be sent.outcome - Synchronization used to set state prior to completion of the send call.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
JmsTransactionContextacknowledge in interface JmsTransactionContextconnection - 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 boolean isInDoubt()
isInDoubt in interface JmsTransactionContextpublic void begin()
throws javax.jms.JMSException
JmsTransactionContextbegin in interface JmsTransactionContextjavax.jms.JMSException - on internal error occurs.public void commit()
throws javax.jms.JMSException
JmsTransactionContextcommit in interface JmsTransactionContextjavax.jms.JMSException - if the commit fails to roll back the transaction due to some internal error.public void rollback()
throws javax.jms.JMSException
JmsTransactionContextrollback in interface JmsTransactionContextjavax.jms.JMSException - if the JMS provider fails to roll back the transaction due to some internal error.public void shutdown()
throws javax.jms.JMSException
JmsTransactionContextshutdown in interface JmsTransactionContextjavax.jms.JMSException - if the JMS provider fails to roll back the transaction due to some internal error.public void onConnectionInterrupted()
JmsTransactionContextonConnectionInterrupted in interface JmsTransactionContextpublic void onConnectionRecovery(Provider provider) throws Exception
JmsTransactionContextonConnectionRecovery in interface JmsTransactionContextprovider - A reference to the provider that manages the new connection.Exception - if an error occurs while rebuilding against the new provider.public JmsTransactionId getTransactionId()
getTransactionId in interface JmsTransactionContextpublic JmsTransactionListener getListener()
getListener in interface JmsTransactionContextpublic void setListener(JmsTransactionListener listener)
JmsTransactionContextsetListener in interface JmsTransactionContextlistener - the JMS Transaction listener that will be sent all TX event notifications.public boolean isInTransaction()
isInTransaction in interface JmsTransactionContextpublic boolean isActiveInThisContext(JmsResourceId resouceId)
JmsTransactionContextisActiveInThisContext in interface JmsTransactionContextresouceId - The JmsResourceId of the resource making this query.Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.