org.infinispan.interceptors
Class TxInterceptor
java.lang.Object
org.infinispan.commands.AbstractVisitor
org.infinispan.interceptors.base.CommandInterceptor
org.infinispan.interceptors.TxInterceptor
- All Implemented Interfaces:
- Visitor
- Direct Known Subclasses:
- DistTxInterceptor
public class TxInterceptor
- extends CommandInterceptor
Interceptor in charge with handling transaction related operations, e.g enlisting cache as an transaction
participant, propagating remotely initiated changes.
- Since:
- 4.0
- Author:
- Manik Surtani (manik@jboss.org), Mircea.Markus@jboss.com
- See Also:
TransactionXaAdapter
Method Summary |
LocalTransaction |
enlist(InvocationContext ctx)
|
protected VisitableCommand |
getCommandToReplay(VisitableCommand modification)
Designed to be overridden. |
long |
getCommits()
|
long |
getPrepares()
|
long |
getRollbacks()
|
void |
init(TransactionTable txTable,
TransactionLog transactionLog,
Configuration c,
TransactionCoordinator txCoordinator)
|
boolean |
isStatisticsEnabled()
|
void |
resetStatistics()
|
void |
setStatisticsEnabled(boolean enabled)
|
Object |
visitClearCommand(InvocationContext ctx,
ClearCommand command)
|
Object |
visitCommitCommand(TxInvocationContext ctx,
CommitCommand command)
|
Object |
visitGetKeyValueCommand(InvocationContext ctx,
GetKeyValueCommand command)
|
Object |
visitInvalidateCommand(InvocationContext ctx,
InvalidateCommand invalidateCommand)
|
Object |
visitLockControlCommand(TxInvocationContext ctx,
LockControlCommand command)
|
Object |
visitPrepareCommand(TxInvocationContext ctx,
PrepareCommand command)
|
Object |
visitPutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
|
Object |
visitPutMapCommand(InvocationContext ctx,
PutMapCommand command)
|
Object |
visitRemoveCommand(InvocationContext ctx,
RemoveCommand command)
|
Object |
visitReplaceCommand(InvocationContext ctx,
ReplaceCommand command)
|
Object |
visitRollbackCommand(TxInvocationContext ctx,
RollbackCommand command)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
txCoordinator
protected TransactionCoordinator txCoordinator
TxInterceptor
public TxInterceptor()
init
public void init(TransactionTable txTable,
TransactionLog transactionLog,
Configuration c,
TransactionCoordinator txCoordinator)
visitPrepareCommand
public Object visitPrepareCommand(TxInvocationContext ctx,
PrepareCommand command)
throws Throwable
- Specified by:
visitPrepareCommand
in interface Visitor
- Overrides:
visitPrepareCommand
in class AbstractVisitor
- Throws:
Throwable
visitCommitCommand
public Object visitCommitCommand(TxInvocationContext ctx,
CommitCommand command)
throws Throwable
- Specified by:
visitCommitCommand
in interface Visitor
- Overrides:
visitCommitCommand
in class AbstractVisitor
- Throws:
Throwable
visitRollbackCommand
public Object visitRollbackCommand(TxInvocationContext ctx,
RollbackCommand command)
throws Throwable
- Specified by:
visitRollbackCommand
in interface Visitor
- Overrides:
visitRollbackCommand
in class AbstractVisitor
- Throws:
Throwable
visitLockControlCommand
public Object visitLockControlCommand(TxInvocationContext ctx,
LockControlCommand command)
throws Throwable
- Specified by:
visitLockControlCommand
in interface Visitor
- Overrides:
visitLockControlCommand
in class AbstractVisitor
- Throws:
Throwable
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
throws Throwable
- Specified by:
visitPutKeyValueCommand
in interface Visitor
- Overrides:
visitPutKeyValueCommand
in class AbstractVisitor
- Throws:
Throwable
visitRemoveCommand
public Object visitRemoveCommand(InvocationContext ctx,
RemoveCommand command)
throws Throwable
- Specified by:
visitRemoveCommand
in interface Visitor
- Overrides:
visitRemoveCommand
in class AbstractVisitor
- Throws:
Throwable
visitReplaceCommand
public Object visitReplaceCommand(InvocationContext ctx,
ReplaceCommand command)
throws Throwable
- Specified by:
visitReplaceCommand
in interface Visitor
- Overrides:
visitReplaceCommand
in class AbstractVisitor
- Throws:
Throwable
visitClearCommand
public Object visitClearCommand(InvocationContext ctx,
ClearCommand command)
throws Throwable
- Specified by:
visitClearCommand
in interface Visitor
- Overrides:
visitClearCommand
in class AbstractVisitor
- Throws:
Throwable
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx,
PutMapCommand command)
throws Throwable
- Specified by:
visitPutMapCommand
in interface Visitor
- Overrides:
visitPutMapCommand
in class AbstractVisitor
- Throws:
Throwable
visitInvalidateCommand
public Object visitInvalidateCommand(InvocationContext ctx,
InvalidateCommand invalidateCommand)
throws Throwable
- Specified by:
visitInvalidateCommand
in interface Visitor
- Overrides:
visitInvalidateCommand
in class AbstractVisitor
- Throws:
Throwable
visitGetKeyValueCommand
public Object visitGetKeyValueCommand(InvocationContext ctx,
GetKeyValueCommand command)
throws Throwable
- Specified by:
visitGetKeyValueCommand
in interface Visitor
- Overrides:
visitGetKeyValueCommand
in class AbstractVisitor
- Throws:
Throwable
enlist
public LocalTransaction enlist(InvocationContext ctx)
throws SystemException
- Throws:
SystemException
resetStatistics
public void resetStatistics()
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled)
isStatisticsEnabled
public boolean isStatisticsEnabled()
getPrepares
public long getPrepares()
getCommits
public long getCommits()
getRollbacks
public long getRollbacks()
getCommandToReplay
protected VisitableCommand getCommandToReplay(VisitableCommand modification)
- Designed to be overridden. Returns a VisitableCommand fit for replaying locally, based on the modification passed
in. If a null value is returned, this means that the command should not be replayed.
- Parameters:
modification
- modification in a prepare call
- Returns:
- a VisitableCommand representing this modification, fit for replaying, or null if the command should not be
replayed.
Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.