|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.cache.commands.AbstractVisitor
org.jboss.cache.interceptors.base.CommandInterceptor
org.jboss.cache.interceptors.BaseTransactionalContextInterceptor
org.jboss.cache.interceptors.TxInterceptor
public class TxInterceptor
This interceptor is the new default at the head of all interceptor chains, and makes transactional attributes available to all interceptors in the chain. This interceptor is also responsible for registering for synchronisation on transaction completion.
Field Summary | |
---|---|
protected CommandsFactory |
commandsFactory
|
protected boolean |
optimistic
|
protected RPCManager |
rpcManager
|
Fields inherited from class org.jboss.cache.interceptors.BaseTransactionalContextInterceptor |
---|
txManager, txTable |
Fields inherited from class org.jboss.cache.interceptors.base.CommandInterceptor |
---|
configuration, log, trace |
Constructor Summary | |
---|---|
TxInterceptor()
|
Method Summary | |
---|---|
protected void |
assertTxIsStillValid(Transaction tx)
|
protected Object |
attachGtxAndPassUpChain(InvocationContext ctx,
VisitableCommand command)
|
protected PrepareCommand |
buildPrepareCommand(GlobalTransaction gtx,
List modifications,
boolean onePhaseCommit)
|
protected void |
cleanupStaleLocks(InvocationContext ctx)
|
protected Transaction |
createLocalTx()
Creates and starts a local tx |
protected TransactionEntry |
createNewTransactionEntry(Transaction tx)
|
Map<String,Object> |
dumpStatistics()
Returns a map of statistics. |
long |
getCommits()
Returns the number of transaction commits |
long |
getPrepares()
Returns the number of transaction prepares |
long |
getRollbacks()
Returns the number of transaction rollbacks |
Object |
handleDefault(InvocationContext ctx,
VisitableCommand command)
Tests if we already have a tx running. |
void |
intialize(RPCManager rpcManager,
NotifierImpl notifier,
InvocationContextContainer icc,
CommandsFactory factory,
ComponentRegistry componentRegistry,
LockManager lockManager)
|
protected void |
replayModifications(InvocationContext ctx,
Transaction ltx,
PrepareCommand command)
Replays modifications |
void |
resetStatistics()
Resets statistics gathered. |
protected void |
runCommitPhase(InvocationContext ctx,
GlobalTransaction gtx,
List modifications,
boolean onePhaseCommit)
creates a commit() |
Object |
runPreparePhase(InvocationContext ctx,
GlobalTransaction gtx,
List<ReversibleCommand> modifications)
Handles a local prepare - invoked by the sync handler. |
protected void |
runRollbackPhase(InvocationContext ctx,
GlobalTransaction gtx,
Transaction tx,
List<ReversibleCommand> modifications)
creates a rollback() |
Object |
visitCommitCommand(InvocationContext ctx,
CommitCommand command)
Visits a CommitCommand. |
Object |
visitInvalidateCommand(InvocationContext ctx,
InvalidateCommand command)
Visits a InvalidateCommand. |
Object |
visitPrepareCommand(InvocationContext ctx,
PrepareCommand command)
Visits a PrepareCommand. |
Object |
visitRollbackCommand(InvocationContext ctx,
RollbackCommand command)
Visits a RollbackCommand. |
Methods inherited from class org.jboss.cache.interceptors.BaseTransactionalContextInterceptor |
---|
copyInvocationScopeOptionsToTxScope, isRollingBack, setTransactionalContext |
Methods inherited from class org.jboss.cache.interceptors.base.CommandInterceptor |
---|
getNext, getStatisticsEnabled, hasNext, invokeNextInterceptor, setNext, setStatisticsEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.cache.interceptors.InterceptorMBean |
---|
getStatisticsEnabled, setStatisticsEnabled |
Field Detail |
---|
protected CommandsFactory commandsFactory
protected RPCManager rpcManager
protected boolean optimistic
Constructor Detail |
---|
public TxInterceptor()
Method Detail |
---|
public void intialize(RPCManager rpcManager, NotifierImpl notifier, InvocationContextContainer icc, CommandsFactory factory, ComponentRegistry componentRegistry, LockManager lockManager)
public Object visitPrepareCommand(InvocationContext ctx, PrepareCommand command) throws Throwable
Visitor
visitPrepareCommand
in interface Visitor
visitPrepareCommand
in class AbstractVisitor
ctx
- invocation contextcommand
- command to visit
Throwable
- in the event of problems.public Object visitCommitCommand(InvocationContext ctx, CommitCommand command) throws Throwable
Visitor
visitCommitCommand
in interface Visitor
visitCommitCommand
in class AbstractVisitor
ctx
- invocation contextcommand
- command to visit
Throwable
- in the event of problems.public Object visitRollbackCommand(InvocationContext ctx, RollbackCommand command) throws Throwable
Visitor
visitRollbackCommand
in interface Visitor
visitRollbackCommand
in class AbstractVisitor
ctx
- invocation contextcommand
- command to visit
Throwable
- in the event of problems.public Object visitInvalidateCommand(InvocationContext ctx, InvalidateCommand command) throws Throwable
Visitor
visitInvalidateCommand
in interface Visitor
visitInvalidateCommand
in class AbstractVisitor
ctx
- invocation contextcommand
- command to visit
Throwable
- in the event of problems.public Object handleDefault(InvocationContext ctx, VisitableCommand command) throws Throwable
handleDefault
in class CommandInterceptor
ctx
- invocation contextcommand
- command to invoke
Throwable
protected Object attachGtxAndPassUpChain(InvocationContext ctx, VisitableCommand command) throws Throwable
Throwable
public long getPrepares()
TxInterceptorMBean
getPrepares
in interface TxInterceptorMBean
public long getCommits()
TxInterceptorMBean
getCommits
in interface TxInterceptorMBean
public long getRollbacks()
TxInterceptorMBean
getRollbacks
in interface TxInterceptorMBean
public void resetStatistics()
CommandInterceptor
resetStatistics
in interface InterceptorMBean
resetStatistics
in class CommandInterceptor
public Map<String,Object> dumpStatistics()
CommandInterceptor
dumpStatistics
in interface InterceptorMBean
dumpStatistics
in class CommandInterceptor
protected TransactionEntry createNewTransactionEntry(Transaction tx) throws Exception
Exception
protected void replayModifications(InvocationContext ctx, Transaction ltx, PrepareCommand command) throws Throwable
ctx
- ltx
- command
-
Exception
Throwable
protected PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List modifications, boolean onePhaseCommit)
protected void runCommitPhase(InvocationContext ctx, GlobalTransaction gtx, List modifications, boolean onePhaseCommit)
protected void cleanupStaleLocks(InvocationContext ctx) throws Throwable
Throwable
protected void runRollbackPhase(InvocationContext ctx, GlobalTransaction gtx, Transaction tx, List<ReversibleCommand> modifications)
public Object runPreparePhase(InvocationContext ctx, GlobalTransaction gtx, List<ReversibleCommand> modifications) throws Throwable
Throwable
protected void assertTxIsStillValid(Transaction tx)
protected Transaction createLocalTx() throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |