|
||||||||||
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(javax.transaction.Transaction tx)
|
protected java.lang.Object |
attachGtxAndPassUpChain(InvocationContext ctx,
VisitableCommand command)
|
protected PrepareCommand |
buildPrepareCommand(GlobalTransaction gtx,
java.util.List modifications,
boolean onePhaseCommit)
|
protected void |
cleanupStaleLocks(InvocationContext ctx)
|
protected javax.transaction.Transaction |
createLocalTx()
Creates and starts a local tx |
java.util.Map<java.lang.String,java.lang.Object> |
dumpStatistics()
|
long |
getCommits()
|
int |
getNumberOfSyncsRegistered()
|
long |
getPrepares()
|
long |
getRollbacks()
|
boolean |
getStatisticsEnabled()
|
java.lang.Object |
handleDefault(InvocationContext ctx,
VisitableCommand command)
Tests if we already have a tx running. |
void |
intialize(RPCManager rpcManager,
ContextFactory contextFactory,
Notifier notifier,
InvocationContextContainer icc,
TransactionLog transactionLog,
CommandsFactory factory,
ComponentRegistry componentRegistry,
LockManager lockManager)
|
protected void |
replayModifications(InvocationContext ctx,
javax.transaction.Transaction ltx,
PrepareCommand command)
Replays modifications |
void |
resetStatistics()
|
protected void |
runCommitPhase(InvocationContext ctx,
GlobalTransaction gtx,
java.util.List modifications,
boolean onePhaseCommit)
creates a commit() |
java.lang.Object |
runPreparePhase(InvocationContext ctx,
GlobalTransaction gtx,
java.util.List<WriteCommand> modifications)
Handles a local prepare - invoked by the sync handler. |
protected void |
runRollbackPhase(InvocationContext ctx,
GlobalTransaction gtx,
javax.transaction.Transaction tx)
creates a rollback() |
void |
setStatisticsEnabled(boolean enabled)
|
java.lang.Object |
visitCommitCommand(InvocationContext ctx,
CommitCommand command)
Visits a CommitCommand. |
java.lang.Object |
visitInvalidateCommand(InvocationContext ctx,
InvalidateCommand command)
Visits a InvalidateCommand. |
java.lang.Object |
visitPrepareCommand(InvocationContext ctx,
PrepareCommand command)
Visits a PrepareCommand. |
java.lang.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, hasNext, invokeNextInterceptor, setNext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected CommandsFactory commandsFactory
protected RPCManager rpcManager
protected boolean optimistic
Constructor Detail |
---|
public TxInterceptor()
Method Detail |
---|
public void intialize(RPCManager rpcManager, ContextFactory contextFactory, Notifier notifier, InvocationContextContainer icc, TransactionLog transactionLog, CommandsFactory factory, ComponentRegistry componentRegistry, LockManager lockManager)
public java.lang.Object visitPrepareCommand(InvocationContext ctx, PrepareCommand command) throws java.lang.Throwable
Visitor
visitPrepareCommand
in interface Visitor
visitPrepareCommand
in class AbstractVisitor
ctx
- invocation contextcommand
- command to visit
java.lang.Throwable
- in the event of problems.public java.lang.Object visitCommitCommand(InvocationContext ctx, CommitCommand command) throws java.lang.Throwable
Visitor
visitCommitCommand
in interface Visitor
visitCommitCommand
in class AbstractVisitor
ctx
- invocation contextcommand
- command to visit
java.lang.Throwable
- in the event of problems.public java.lang.Object visitRollbackCommand(InvocationContext ctx, RollbackCommand command) throws java.lang.Throwable
Visitor
visitRollbackCommand
in interface Visitor
visitRollbackCommand
in class AbstractVisitor
ctx
- invocation contextcommand
- command to visit
java.lang.Throwable
- in the event of problems.public java.lang.Object visitInvalidateCommand(InvocationContext ctx, InvalidateCommand command) throws java.lang.Throwable
Visitor
visitInvalidateCommand
in interface Visitor
visitInvalidateCommand
in class AbstractVisitor
ctx
- invocation contextcommand
- command to visit
java.lang.Throwable
- in the event of problems.public java.lang.Object handleDefault(InvocationContext ctx, VisitableCommand command) throws java.lang.Throwable
handleDefault
in class CommandInterceptor
ctx
- invocation contextcommand
- command to invoke
java.lang.Throwable
protected java.lang.Object attachGtxAndPassUpChain(InvocationContext ctx, VisitableCommand command) throws java.lang.Throwable
java.lang.Throwable
protected void replayModifications(InvocationContext ctx, javax.transaction.Transaction ltx, PrepareCommand command) throws java.lang.Throwable
java.lang.Throwable
protected PrepareCommand buildPrepareCommand(GlobalTransaction gtx, java.util.List modifications, boolean onePhaseCommit)
protected void runCommitPhase(InvocationContext ctx, GlobalTransaction gtx, java.util.List modifications, boolean onePhaseCommit)
protected void cleanupStaleLocks(InvocationContext ctx) throws java.lang.Throwable
java.lang.Throwable
protected void runRollbackPhase(InvocationContext ctx, GlobalTransaction gtx, javax.transaction.Transaction tx)
public java.lang.Object runPreparePhase(InvocationContext ctx, GlobalTransaction gtx, java.util.List<WriteCommand> modifications) throws java.lang.Throwable
java.lang.Throwable
protected void assertTxIsStillValid(javax.transaction.Transaction tx)
protected javax.transaction.Transaction createLocalTx() throws java.lang.Exception
java.lang.Exception
public void resetStatistics()
public java.util.Map<java.lang.String,java.lang.Object> dumpStatistics()
public boolean getStatisticsEnabled()
public void setStatisticsEnabled(boolean enabled)
public long getPrepares()
public long getCommits()
public long getRollbacks()
public int getNumberOfSyncsRegistered()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |