|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TransactionLogger
Typically adding a command, the following pattern would be used:
if (txLogger.logIfNeeded(cmd)) {
// do NOT proceed with executing this command!
} else {
// proceed with executing this command as per normal!
}
When draining, the following pattern should be used:
List<WriteCommand> c = null;
while (txLogger.shouldDrainWithoutLock()) {
c = txLogger.drain();
applyCommands(c);
}
c = txLogger.drainAndLock();
applyCommands(c);
applyPendingPrepares(txLogger.getPendingPrepares());
txLogger.unlockAndDisable();
| Method Summary | |
|---|---|
void |
blockNewTransactions()
Causes new transactions to block when testing isEnabled(). |
void |
enable()
Enables transaction logging |
boolean |
isEnabled()
Checks whether transaction logging is enabled |
void |
logIfNeeded(CommitCommand command,
TxInvocationContext context)
Logs a CommitCommand if needed. |
void |
logIfNeeded(PrepareCommand command)
Logs a PrepareCommand if needed. |
void |
logIfNeeded(RollbackCommand command)
Logs a RollbackCommand if needed. |
boolean |
logIfNeeded(WriteCommand command)
If logging is enabled, will log the command and return true. |
void |
logModificationsIfNeeded(CommitCommand commit,
TxInvocationContext context)
A mechanism for commit commands to register modifications instead of a prepare. |
void |
unblockNewTransactions()
Unblocks anything blocking on isEnabled(). |
| Methods inherited from interface org.infinispan.distribution.RemoteTransactionLogger |
|---|
drain, drainAndLock, getPendingPrepares, shouldDrainWithoutLock, unlockAndDisable |
| Method Detail |
|---|
void enable()
boolean logIfNeeded(WriteCommand command)
command - command to log
void logIfNeeded(PrepareCommand command)
command - PrepoareCommand to log
void logIfNeeded(CommitCommand command,
TxInvocationContext context)
command - CommitCommand to logvoid logIfNeeded(RollbackCommand command)
command - RollbackCommand to logboolean isEnabled()
void logModificationsIfNeeded(CommitCommand commit,
TxInvocationContext context)
commit - commit commandcontext - context from which to extract modification listvoid blockNewTransactions()
void unblockNewTransactions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||