|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TransactionContext
Captures information pertaining to a specific JTA transaction.
This was a concrete class called TransactionEntry prior to 3.0.
InvocationContext
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. |
Method Detail |
---|
void addModification(WriteCommand command)
command
- modificationList<WriteCommand> getModifications()
void addLocalModification(WriteCommand command)
command
- command to add to list. Should not be null.
NullPointerException
- if the command to be added is null.List<WriteCommand> getLocalModifications()
void addRemovedNode(Fqn fqn)
fqn
- fqn that has been removed.
NullPointerException
- if the Fqn is null.List<Fqn> getRemovedNodes()
void setTransaction(Transaction tx)
tx
- JTA transaction to associate with.Transaction getTransaction()
void addLock(Object lock)
InvocationContext.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 Fqn
s 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
.
lock
- lock to addInvocationContext.addLock(Object)
void removeLock(Object lock)
InvocationContext.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 Fqn
s 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
.
lock
- lock to removeInvocationContext.removeLock(Object)
void clearLocks()
InvocationContext.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 Fqn
s 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
.
InvocationContext.clearLocks()
void addAllLocks(List newLocks)
InvocationContext.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
newLocks
- locks to addInvocationContext.addAllLocks(java.util.List)
List getLocks()
InvocationContext.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
InvocationContext.getLocks()
boolean hasLock(Object lock)
InvocationContext.hasLock(Object)
()} instead,
which would delegate to this method if a transaction is in scope or otherwise use invocation-specific locks.
lock
- lock to test
boolean isForceAsyncReplication()
Cache.putForExternalRead(org.jboss.cache.Fqn,Object,Object)
within
a transactional context.
void setForceAsyncReplication(boolean forceAsyncReplication)
Cache.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).
forceAsyncReplication
- value of forceAsyncReplicationboolean isForceSyncReplication()
Cache.putForExternalRead(org.jboss.cache.Fqn,Object,Object)
within
a transactional context.
void setForceSyncReplication(boolean forceSyncReplication)
Cache.putForExternalRead(org.jboss.cache.Fqn,Object,Object)
within
a transactional context.
forceSyncReplication
- value of forceSyncReplicationvoid addDummyNodeCreatedByCacheLoader(Fqn fqn)
fqn
- fqn to add. Must not be null.List<Fqn> getDummyNodesCreatedByCacheLoader()
void setOption(Option o)
o
- option to setOption getOption()
OrderedSynchronizationHandler getOrderedSynchronizationHandler()
void setOrderedSynchronizationHandler(OrderedSynchronizationHandler orderedSynchronizationHandler)
orderedSynchronizationHandler
- to setboolean hasModifications()
boolean hasLocalModifications()
boolean hasAnyModifications()
void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |