|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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.
Nested Class Summary | |
---|---|
class |
TxInterceptor.ModificationsReplayVisitor
|
Field Summary |
---|
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 | |
---|---|
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,
Notifier notifier,
InvocationContextContainer icc,
LifecycleManager lifecycleManager,
CommandsFactory factory)
|
void |
resetStatistics()
Resets statistics gathered. |
protected void |
runCommitPhase(InvocationContext ctx,
GlobalTransaction gtx,
Transaction tx,
List modifications,
List clModifications,
boolean onePhaseCommit)
creates a commit() MethodCall and feeds it to handleCommitRollback(); |
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() MethodCall and feeds it to handleCommitRollback(); |
Object |
visitCommitCommand(InvocationContext ctx,
CommitCommand command)
Visits a CommitCommand. |
Object |
visitInvalidateCommand(InvocationContext ctx,
InvalidateCommand command)
Visits a InvalidateCommand. |
Object |
visitOptimisticPrepareCommand(InvocationContext ctx,
OptimisticPrepareCommand command)
Visits a OptimisticPrepareCommand. |
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 |
Constructor Detail |
---|
public TxInterceptor()
Method Detail |
---|
public void intialize(RPCManager rpcManager, Notifier notifier, InvocationContextContainer icc, LifecycleManager lifecycleManager, CommandsFactory factory)
public Object visitOptimisticPrepareCommand(InvocationContext ctx, OptimisticPrepareCommand command) throws Throwable
Visitor
visitOptimisticPrepareCommand
in interface Visitor
visitOptimisticPrepareCommand
in class AbstractVisitor
ctx
- invocation contextcommand
- command to visit
Throwable
- in the event of problems.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 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
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 void runCommitPhase(InvocationContext ctx, GlobalTransaction gtx, Transaction tx, List modifications, List clModifications, boolean onePhaseCommit)
protected void runRollbackPhase(InvocationContext ctx, GlobalTransaction gtx, Transaction tx, List<ReversibleCommand> modifications)
gtx
- public Object runPreparePhase(InvocationContext ctx, GlobalTransaction gtx, List<ReversibleCommand> modifications) throws Throwable
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |