Package org.apache.qpid.server.txn
Class AsyncAutoCommitTransaction
- java.lang.Object
-
- org.apache.qpid.server.txn.AsyncAutoCommitTransaction
-
- All Implemented Interfaces:
ServerTransaction
public class AsyncAutoCommitTransaction extends Object implements ServerTransaction
An implementation of ServerTransaction where each enqueue/dequeue operation takes place within it own transaction. Since there is no long-lived transaction, the commit and rollback methods of this implementation are empty.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AsyncAutoCommitTransaction.FutureRecorder
-
Nested classes/interfaces inherited from interface org.apache.qpid.server.txn.ServerTransaction
ServerTransaction.Action, ServerTransaction.EnqueueAction
-
-
Constructor Summary
Constructors Constructor Description AsyncAutoCommitTransaction(MessageStore transactionLog, AsyncAutoCommitTransaction.FutureRecorder recorder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPostTransactionAction(ServerTransaction.Action immediateAction)
Since AutoCommitTransaction have no concept of a long lived transaction, any Actions registered by the caller are executed immediately.void
commit()
Commit the transaction represented by this object.void
commit(Runnable immediatePostTransactionAction)
void
dequeue(Collection<MessageInstance> queueEntries, ServerTransaction.Action postTransactionAction)
Dequeue a message(s) from queue(s) registering a post transaction action.void
dequeue(MessageEnqueueRecord record, ServerTransaction.Action postTransactionAction)
Dequeue a message from a queue registering a post transaction action.void
enqueue(Collection<? extends BaseQueue> queues, EnqueueableMessage message, ServerTransaction.EnqueueAction postTransactionAction)
Enqueue a message(s) to queue(s) registering a post transaction action.void
enqueue(TransactionLogResource queue, EnqueueableMessage message, ServerTransaction.EnqueueAction postTransactionAction)
Enqueue a message to a queue registering a post transaction action.long
getTransactionStartTime()
Return the time the current transaction started.long
getTransactionUpdateTime()
Return the time of the last activity on the current transaction.boolean
isTransactional()
void
rollback()
Rollback the transaction represented by this object.
-
-
-
Constructor Detail
-
AsyncAutoCommitTransaction
public AsyncAutoCommitTransaction(MessageStore transactionLog, AsyncAutoCommitTransaction.FutureRecorder recorder)
-
-
Method Detail
-
getTransactionStartTime
public long getTransactionStartTime()
Description copied from interface:ServerTransaction
Return the time the current transaction started.- Specified by:
getTransactionStartTime
in interfaceServerTransaction
- Returns:
- the time this transaction started or 0 if not in a transaction
-
getTransactionUpdateTime
public long getTransactionUpdateTime()
Description copied from interface:ServerTransaction
Return the time of the last activity on the current transaction.- Specified by:
getTransactionUpdateTime
in interfaceServerTransaction
- Returns:
- the time of the last activity or 0 if not in a transaction
-
addPostTransactionAction
public void addPostTransactionAction(ServerTransaction.Action immediateAction)
Since AutoCommitTransaction have no concept of a long lived transaction, any Actions registered by the caller are executed immediately.- Specified by:
addPostTransactionAction
in interfaceServerTransaction
-
dequeue
public void dequeue(MessageEnqueueRecord record, ServerTransaction.Action postTransactionAction)
Description copied from interface:ServerTransaction
Dequeue a message from a queue registering a post transaction action. A store operation will result only for a if the record is not null.- Specified by:
dequeue
in interfaceServerTransaction
-
dequeue
public void dequeue(Collection<MessageInstance> queueEntries, ServerTransaction.Action postTransactionAction)
Description copied from interface:ServerTransaction
Dequeue a message(s) from queue(s) registering a post transaction action. Store operations will result only for a persistent messages on durable queues.- Specified by:
dequeue
in interfaceServerTransaction
-
enqueue
public void enqueue(TransactionLogResource queue, EnqueueableMessage message, ServerTransaction.EnqueueAction postTransactionAction)
Description copied from interface:ServerTransaction
Enqueue a message to a queue registering a post transaction action. A store operation will result only for a persistent message on a durable queue.- Specified by:
enqueue
in interfaceServerTransaction
-
enqueue
public void enqueue(Collection<? extends BaseQueue> queues, EnqueueableMessage message, ServerTransaction.EnqueueAction postTransactionAction)
Description copied from interface:ServerTransaction
Enqueue a message(s) to queue(s) registering a post transaction action. Store operations will result only for a persistent messages on durable queues.- Specified by:
enqueue
in interfaceServerTransaction
-
commit
public void commit(Runnable immediatePostTransactionAction)
- Specified by:
commit
in interfaceServerTransaction
-
commit
public void commit()
Description copied from interface:ServerTransaction
Commit the transaction represented by this object. If the caller has registered one or more Actions, the postCommit() method on each will be executed immediately after the underlying transaction has committed.- Specified by:
commit
in interfaceServerTransaction
-
rollback
public void rollback()
Description copied from interface:ServerTransaction
Rollback the transaction represented by this object. If the caller has registered one or more Actions, the onRollback() method on each will be executed immediately after the underlying transaction has rolled-back.- Specified by:
rollback
in interfaceServerTransaction
-
isTransactional
public boolean isTransactional()
- Specified by:
isTransactional
in interfaceServerTransaction
-
-