|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.cache.transaction.AbstractTransactionContext
public abstract class AbstractTransactionContext
An abstract transaction context
| Constructor Summary | |
|---|---|
AbstractTransactionContext(Transaction tx)
|
|
| Method Summary | |
|---|---|
void |
addAllLocks(List newLocks)
Adds a List of locks to the currently maintained collection of locks acquired. |
void |
addDummyNodeCreatedByCacheLoader(Fqn fqn)
Adds an Fqn to the list of uninitialized nodes created by the cache loader. |
void |
addLocalModification(WriteCommand command)
Adds a modification to the local modification list. |
void |
addLock(Object lock)
Adds a lock to the currently maintained collection of locks acquired. |
void |
addModification(WriteCommand command)
Adds a modification to the modification list. |
void |
addRemovedNode(Fqn fqn)
Adds the node that has been removed in the scope of the current transaction. |
void |
clearLocks()
Clears all locks from the currently maintained collection of locks acquired. |
List<Fqn> |
getDummyNodesCreatedByCacheLoader()
|
List<WriteCommand> |
getLocalModifications()
Returns all modifications that have been invoked with the LOCAL cache mode option. |
List |
getLocks()
Returns an immutable, defensive copy of the List of locks currently maintained for the transaction. |
List<WriteCommand> |
getModifications()
Returns all modifications. |
Option |
getOption()
Retrieves a transaction scope option override |
OrderedSynchronizationHandler |
getOrderedSynchronizationHandler()
|
List<Fqn> |
getRemovedNodes()
Gets the list of removed nodes. |
Transaction |
getTransaction()
Returns a local transaction associated with this context. |
boolean |
hasAnyModifications()
|
boolean |
hasLocalModifications()
|
boolean |
hasLock(Object lock)
Most code could not use this method directly, but use InvocationContext.hasLock(Object) ()} instead,
which would delegate to this method if a transaction is in scope or otherwise use invocation-specific locks. |
boolean |
hasModifications()
|
boolean |
isForceAsyncReplication()
Gets the value of the forceAsyncReplication flag. |
boolean |
isForceSyncReplication()
Gets the value of the forceSyncReplication flag. |
void |
removeLock(Object lock)
Removes a lock from the currently maintained collection of locks acquired. |
void |
reset()
Cleans up internal state, freeing up references. |
void |
setForceAsyncReplication(boolean forceAsyncReplication)
Sets the value of the forceAsyncReplication flag. |
void |
setForceSyncReplication(boolean forceSyncReplication)
Sets the value of the forceSyncReplication flag. |
void |
setOption(Option o)
Sets a transaction-scope option override |
void |
setOrderedSynchronizationHandler(OrderedSynchronizationHandler orderedSynchronizationHandler)
Associates an ordered sync handler with this transaction. |
void |
setTransaction(Transaction tx)
Sets the local transaction to be associated with this transaction context. |
String |
toString()
Returns debug information about this transaction. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractTransactionContext(Transaction tx)
throws SystemException,
RollbackException
SystemException
RollbackException| Method Detail |
|---|
public void addModification(WriteCommand command)
TransactionContext
addModification in interface TransactionContextcommand - modificationpublic List<WriteCommand> getModifications()
TransactionContext
getModifications in interface TransactionContextpublic void addLocalModification(WriteCommand command)
TransactionContext
addLocalModification in interface TransactionContextcommand - command to add to list. Should not be null.public List<WriteCommand> getLocalModifications()
TransactionContext
getLocalModifications in interface TransactionContextpublic void addRemovedNode(Fqn fqn)
TransactionContext
addRemovedNode in interface TransactionContextfqn - fqn that has been removed.public List<Fqn> getRemovedNodes()
TransactionContext
getRemovedNodes in interface TransactionContextpublic void setTransaction(Transaction tx)
TransactionContext
setTransaction in interface TransactionContexttx - JTA transaction to associate with.public Transaction getTransaction()
TransactionContext
getTransaction in interface TransactionContextpublic void addLock(Object lock)
TransactionContextInvocationContext.addLock(Object) instead,
which would delegate to this method if a transaction is in scope or otherwise use invocation-specific locks.
Note that currently (as of 3.0.0) this lock is weakly typed. This is to allow support for both MVCC (which uses Fqns as locks)
as well as legacy Optimistic and Pessimistic Locking schemes (which use NodeLock as locks). Once support for
legacy node locking schemes are dropped, this method will be more strongly typed to accept Fqn.
addLock in interface TransactionContextlock - lock to addInvocationContext.addLock(Object)public void removeLock(Object lock)
TransactionContextInvocationContext.removeLock(Object) instead,
which would delegate to this method if a transaction is in scope or otherwise use invocation-specific locks.
Note that currently (as of 3.0.0) this lock is weakly typed. This is to allow support for both MVCC (which uses Fqns as locks)
as well as legacy Optimistic and Pessimistic Locking schemes (which use NodeLock as locks). Once support for
legacy node locking schemes are dropped, this method will be more strongly typed to accept Fqn.
removeLock in interface TransactionContextlock - lock to removeInvocationContext.removeLock(Object)public void clearLocks()
TransactionContextInvocationContext.clearLocks() instead,
which would delegate to this method if a transaction is in scope or otherwise use invocation-specific locks.
Note that currently (as of 3.0.0) this lock is weakly typed. This is to allow support for both MVCC (which uses Fqns as locks)
as well as legacy Optimistic and Pessimistic Locking schemes (which use NodeLock as locks). Once support for
legacy node locking schemes are dropped, this method will be more strongly typed to accept Fqn.
clearLocks in interface TransactionContextInvocationContext.clearLocks()public boolean hasLock(Object lock)
TransactionContextInvocationContext.hasLock(Object) ()} instead,
which would delegate to this method if a transaction is in scope or otherwise use invocation-specific locks.
hasLock in interface TransactionContextlock - lock to test
public void addAllLocks(List newLocks)
TransactionContextInvocationContext.addAllLocks(java.util.List) instead,
which would delegate to this method if a transaction is in scope or otherwise use invocation-specific locks.
Note that currently (as of 3.0.0) this list is unchecked. This is to allow support for both MVCC (which uses Fqns as locks)
as well as legacy Optimistic and Pessimistic Locking schemes (which use NodeLock as locks). Once support for
legacy node locking schemes are dropped, this method will be more strongly typed to accept List
addAllLocks in interface TransactionContextnewLocks - locks to addInvocationContext.addAllLocks(java.util.List)public List getLocks()
TransactionContextInvocationContext.getLocks() instead,
which would delegate to this method if a transaction is in scope or otherwise use invocation-specific locks.
Note that currently (as of 3.0.0) this list is unchecked. This is to allow support for both MVCC (which uses Fqns as locks)
as well as legacy Optimistic and Pessimistic Locking schemes (which use NodeLock as locks). Once support for
legacy node locking schemes are dropped, this method will be more strongly typed to return List
getLocks in interface TransactionContextInvocationContext.getLocks()public boolean isForceAsyncReplication()
TransactionContextCache.putForExternalRead(org.jboss.cache.Fqn,Object,Object) within
a transactional context.
isForceAsyncReplication in interface TransactionContextpublic void setForceAsyncReplication(boolean forceAsyncReplication)
TransactionContextCache.putForExternalRead(org.jboss.cache.Fqn,Object,Object) within
a transactional context. Also used by OptimisticReplicationInterceptor when dealing
with Option.setForceAsynchronous(boolean) in a
non-transactional context (i.e. with an implicit transaction).
setForceAsyncReplication in interface TransactionContextforceAsyncReplication - value of forceAsyncReplicationpublic boolean isForceSyncReplication()
TransactionContextCache.putForExternalRead(org.jboss.cache.Fqn,Object,Object) within
a transactional context.
isForceSyncReplication in interface TransactionContextpublic void setForceSyncReplication(boolean forceSyncReplication)
TransactionContextCache.putForExternalRead(org.jboss.cache.Fqn,Object,Object) within
a transactional context.
setForceSyncReplication in interface TransactionContextforceSyncReplication - value of forceSyncReplicationpublic String toString()
toString in class Objectpublic void addDummyNodeCreatedByCacheLoader(Fqn fqn)
TransactionContext
addDummyNodeCreatedByCacheLoader in interface TransactionContextfqn - fqn to add. Must not be null.public List<Fqn> getDummyNodesCreatedByCacheLoader()
getDummyNodesCreatedByCacheLoader in interface TransactionContextpublic void setOption(Option o)
TransactionContext
setOption in interface TransactionContexto - option to setpublic Option getOption()
TransactionContext
getOption in interface TransactionContextpublic OrderedSynchronizationHandler getOrderedSynchronizationHandler()
getOrderedSynchronizationHandler in interface TransactionContextpublic void setOrderedSynchronizationHandler(OrderedSynchronizationHandler orderedSynchronizationHandler)
TransactionContext
setOrderedSynchronizationHandler in interface TransactionContextorderedSynchronizationHandler - to setpublic boolean hasModifications()
hasModifications in interface TransactionContextpublic boolean hasLocalModifications()
hasLocalModifications in interface TransactionContextpublic boolean hasAnyModifications()
hasAnyModifications in interface TransactionContextpublic void reset()
TransactionContext
reset in interface TransactionContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||