|
||||||||||
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:
txLogger.beforeCommand();
try {
// execute this command!
} finally {
txLogger.afterCommand(cmd);
}
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 |
afterCommand(CommitCommand command,
TxInvocationContext context)
Logs a CommitCommand if needed. |
void |
afterCommand(PrepareCommand command)
Logs a PrepareCommand if needed. |
void |
afterCommand(RollbackCommand command)
Logs a RollbackCommand if needed. |
void |
afterCommand(WriteCommand command)
Logs a write command (if needed). |
void |
beforeCommand(CommitCommand command,
TxInvocationContext context)
Notify the transaction logger before a commit command, potentially blocking. |
void |
beforeCommand(PrepareCommand command)
Notify the transaction logger before a prepare command, potentially blocking. |
void |
beforeCommand(RollbackCommand command)
Notify the transaction logger before a rollback command, potentially blocking. |
void |
beforeCommand(WriteCommand command)
Notify the transaction logger before a write command, potentially blocking. |
void |
blockNewTransactions()
Causes new transactions to block when calling beforeCommand() . |
void |
enable()
Enables transaction logging |
boolean |
isEnabled()
Checks whether transaction logging is enabled |
void |
unblockNewTransactions()
Unblocks anything blocking on beforeCommand() . |
Methods inherited from interface org.infinispan.distribution.RemoteTransactionLogger |
---|
drain, drainAndLock, getPendingPrepares, shouldDrainWithoutLock, unlockAndDisable |
Method Detail |
---|
void enable()
void afterCommand(WriteCommand command) throws InterruptedException
command
- command to log
InterruptedException
void afterCommand(PrepareCommand command) throws InterruptedException
command
- PrepoareCommand to log
InterruptedException
void afterCommand(CommitCommand command, TxInvocationContext context) throws InterruptedException
command
- CommitCommand to log
InterruptedException
void afterCommand(RollbackCommand command) throws InterruptedException
command
- RollbackCommand to log
InterruptedException
boolean isEnabled()
void beforeCommand(WriteCommand command) throws InterruptedException
InterruptedException
void beforeCommand(PrepareCommand command) throws InterruptedException
InterruptedException
void beforeCommand(CommitCommand command, TxInvocationContext context) throws InterruptedException
InterruptedException
void beforeCommand(RollbackCommand command) throws InterruptedException
InterruptedException
void blockNewTransactions() throws InterruptedException
beforeCommand()
.
InterruptedException
void unblockNewTransactions() throws InterruptedException
beforeCommand()
.
InterruptedException
|
--> | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |