org.jboss.cache.transaction
Class TransactionEntry

java.lang.Object
  extended by org.jboss.cache.transaction.TransactionEntry
Direct Known Subclasses:
OptimisticTransactionEntry

@ThreadSafe
public class TransactionEntry
extends java.lang.Object

Information associated with a GlobalTransaction about the transaction state.

A TransactionEntry maintains:

Version:
$Revision: 1.10 $
Author:
Bela Ban Apr 14, 2003

Constructor Summary
TransactionEntry()
          Constructs a new TransactionEntry.
 
Method Summary
 void addCacheLoaderModification(MethodCall m)
           
 void addLock(NodeLock l)
          Adds a lock to the end of the lock list, if it isn't already present.
 void addLocks(java.util.Collection<NodeLock> newLocks)
          Add multiple locks to the lock list.
 void addModification(MethodCall m)
          Adds a modification to the modification list.
 void addRemovedNode(Fqn fqn)
          Adds the node that has been removed.
 void addUndoOperation(MethodCall m)
          Adds an undo operation to the undo list.
 java.util.List<MethodCall> getCacheLoaderModifications()
           
 java.util.List<Fqn> getDummyNodesCreatedByCacheLoader()
           
 java.util.List<NodeLock> getLocks()
          Returns the locks in use.
 java.util.List<MethodCall> getModifications()
          Returns all modifications.
 Option getOption()
          Retrieves a transaction scope option override
 java.util.List<Fqn> getRemovedNodes()
          Gets the list of removed nodes.
 javax.transaction.Transaction getTransaction()
          Returns a local transaction associated with this TransactionEntry
 java.util.List<MethodCall> getUndoOperations()
          Returns the undo operations in use.
 boolean isForceAsyncReplication()
          Gets the value of the forceAsyncReplication flag.
 void loadUninitialisedNode(Fqn fqn)
           
 void releaseAllLocksFIFO(java.lang.Object owner)
          Releases all locks held by the owner, in order of creation.
 void releaseAllLocksLIFO(java.lang.Object owner)
          Releases all locks held by the owner, in reverse order of creation.
 void setForceAsyncReplication(boolean forceAsyncReplication)
          Sets the value of the forceAsyncReplication flag.
 void setOption(Option o)
          Sets a transaction-scope option override
 void setTransaction(javax.transaction.Transaction tx)
          Sets the local transaction for this entry.
 java.lang.String toString()
          Returns debug information about this transaction.
 void undoOperations(CacheSPI cache)
          Posts all undo operations to the CacheImpl.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransactionEntry

public TransactionEntry()
Constructs a new TransactionEntry.

Method Detail

addModification

public void addModification(MethodCall m)
Adds a modification to the modification list.


addCacheLoaderModification

public void addCacheLoaderModification(MethodCall m)

getModifications

public java.util.List<MethodCall> getModifications()
Returns all modifications.


getCacheLoaderModifications

public java.util.List<MethodCall> getCacheLoaderModifications()

addUndoOperation

public void addUndoOperation(MethodCall m)
Adds an undo operation to the undo list.

See Also:
undoOperations(org.jboss.cache.CacheSPI)

addRemovedNode

public void addRemovedNode(Fqn fqn)
Adds the node that has been removed.

Parameters:
fqn -

getRemovedNodes

public java.util.List<Fqn> getRemovedNodes()
Gets the list of removed nodes.


getUndoOperations

public java.util.List<MethodCall> getUndoOperations()
Returns the undo operations in use. Note: This list may be concurrently modified.


setTransaction

public void setTransaction(javax.transaction.Transaction tx)
Sets the local transaction for this entry.


getTransaction

public javax.transaction.Transaction getTransaction()
Returns a local transaction associated with this TransactionEntry


addLock

public void addLock(NodeLock l)
Adds a lock to the end of the lock list, if it isn't already present.


addLocks

public void addLocks(java.util.Collection<NodeLock> newLocks)
Add multiple locks to the lock list.

Parameters:
newLocks - Collection

getLocks

public java.util.List<NodeLock> getLocks()
Returns the locks in use.

Returns:
a defensive copy of the internal data structure.

releaseAllLocksLIFO

public void releaseAllLocksLIFO(java.lang.Object owner)
Releases all locks held by the owner, in reverse order of creation. Clears the list of locks held.


releaseAllLocksFIFO

public void releaseAllLocksFIFO(java.lang.Object owner)
Releases all locks held by the owner, in order of creation. Does not clear the list of locks held.


isForceAsyncReplication

public boolean isForceAsyncReplication()
Gets the value of the forceAsyncReplication flag. Used by ReplicationInterceptor and OptimisticReplicationInterceptor when dealing with Cache.putForExternalRead(org.jboss.cache.Fqn,Object,Object) within a transactional context.

Returns:
true if the forceAsyncReplication flag is set to true.

setForceAsyncReplication

public void setForceAsyncReplication(boolean forceAsyncReplication)
Sets the value of the forceAsyncReplication flag. Used by ReplicationInterceptor and OptimisticReplicationInterceptor when dealing with Cache.putForExternalRead(org.jboss.cache.Fqn,Object,Object) within a transactional context.

Parameters:
forceAsyncReplication - value of forceAsyncReplication

undoOperations

public void undoOperations(CacheSPI cache)
Posts all undo operations to the CacheImpl.


toString

public java.lang.String toString()
Returns debug information about this transaction.

Overrides:
toString in class java.lang.Object

loadUninitialisedNode

public void loadUninitialisedNode(Fqn fqn)

getDummyNodesCreatedByCacheLoader

public java.util.List<Fqn> getDummyNodesCreatedByCacheLoader()

setOption

public void setOption(Option o)
Sets a transaction-scope option override

Parameters:
o -

getOption

public Option getOption()
Retrieves a transaction scope option override