use of org.apache.qpid.server.txn.DistributedTransaction in project qpid-broker-j by apache.
the class ServerSession method endDtx.
public void endDtx(Xid xid, boolean fail, boolean suspend) throws NotAssociatedDtxException, UnknownDtxBranchException, DtxNotSelectedException, SuspendAndFailDtxException, TimeoutDtxException {
DistributedTransaction distributedTransaction = assertDtxTransaction();
distributedTransaction.end(toDtxXid(xid), fail, suspend);
}
use of org.apache.qpid.server.txn.DistributedTransaction in project qpid-broker-j by apache.
the class ServerSession method startDtx.
public void startDtx(Xid xid, boolean join, boolean resume) throws JoinAndResumeDtxException, UnknownDtxBranchException, AlreadyKnownDtxException, DtxNotSelectedException {
DistributedTransaction distributedTransaction = assertDtxTransaction();
distributedTransaction.start(toDtxXid(xid), join, resume);
}
use of org.apache.qpid.server.txn.DistributedTransaction in project qpid-broker-j by apache.
the class ServerSession method onClose.
public void onClose() {
AMQPConnection_0_10 amqpConnection = getAMQPConnection();
if (_transaction instanceof LocalTransaction) {
if (((LocalTransaction) _transaction).hasOutstandingWork()) {
amqpConnection.incrementTransactionRollbackCounter();
}
amqpConnection.decrementTransactionOpenCounter();
_transaction.rollback();
amqpConnection.unregisterTransactionTickers(_transaction);
} else if (_transaction instanceof DistributedTransaction) {
getAddressSpace().getDtxRegistry().endAssociations(_modelObject);
}
for (MessageDispositionChangeListener listener : _messageDispositionListenerMap.values()) {
listener.onRelease(true, true);
}
_messageDispositionListenerMap.clear();
for (Action<? super Session_0_10> task : _modelObject.getTaskList()) {
task.performAction(_modelObject);
}
LogMessage operationalLoggingMessage = _forcedCloseLogMessage.get();
if (operationalLoggingMessage == null && getConnection().getConnectionCloseMessage() != null) {
operationalLoggingMessage = ChannelMessages.CLOSE_FORCED(getConnection().getConnectionCloseCode(), getConnection().getConnectionCloseMessage());
}
if (operationalLoggingMessage == null) {
operationalLoggingMessage = ChannelMessages.CLOSE();
}
amqpConnection.getEventLogger().message(getLogSubject(), operationalLoggingMessage);
}
Aggregations