org.jboss.cache
Class TransactionEntry

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

public class TransactionEntry
extends java.lang.Object

This is the value (key being the GlobalTransaction) in the transaction table of TreeCache.
A TransactionEntry maintains

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

Field Summary
protected  java.util.List cl_mod_list
           
protected  java.util.List dummyNodesCreatedByCacheLoader
          A list of dummy uninitialised nodes created by the cache loader interceptor to load data for a given node in this tx.
protected  javax.transaction.Transaction ltx
          Local transaction
protected  java.util.List modification_list
          List of modifications (MethodCall).
protected  Option option
           
protected  java.util.List removedNodes
          List of nodes that have been removed by the transaction
protected  java.util.List undo_list
          List.
 
Constructor Summary
TransactionEntry()
          Constructs a new TransactionEntry.
 
Method Summary
 void addCacheLoaderModification(org.jgroups.blocks.MethodCall m)
           
 void addLock(IdentityLock l)
          Adds a lock to the end of the lock list.
 void addLocks(java.util.Collection newLocks)
          Add multiple locks to the lock list.
 void addModification(org.jgroups.blocks.MethodCall m)
          Adds a modification to the modification list.
 void addRemovedNode(Fqn fqn)
          Adds the node that has been removed.
 void addUndoOperation(org.jgroups.blocks.MethodCall m)
          Adds an undo operation to the undo list.
 java.util.List getCacheLoaderModifications()
           
 java.util.List getDummyNodesCreatedByCacheLoader()
           
 java.util.List getLocks()
          Returns the locks in use.
 java.util.List getModifications()
          Returns all modifications.
 Option getOption()
          Retrieves a transaction scope option override
 java.util.List getRemovedNodes()
          Gets the list of removed nodes.
 javax.transaction.Transaction getTransaction()
          Returns a local transaction associated with this TransactionEntry
 java.util.List getUndoOperations()
          Returns the undo operations in use.
 void loadUninitialisedNode(Fqn fqn)
           
 void releaseAllLocks(java.lang.Object owner)
          Deprecated. don't think this is used anymore
 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 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(TreeCache cache)
          Posts all undo operations to the TreeCache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ltx

protected javax.transaction.Transaction ltx
Local transaction


option

protected Option option

modification_list

protected java.util.List modification_list
List of modifications (MethodCall). They will be replicated on TX commit


cl_mod_list

protected java.util.List cl_mod_list

undo_list

protected java.util.List undo_list
List. List of compensating MethodCall objects which revert the ones in modification_list. For each entry in the modification list, we have a corresponding entry in this list. A rollback will simply iterate over this list in reverse to undo the modifications. Note that these undo-ops will never be replicated.


dummyNodesCreatedByCacheLoader

protected java.util.List dummyNodesCreatedByCacheLoader
A list of dummy uninitialised nodes created by the cache loader interceptor to load data for a given node in this tx.


removedNodes

protected java.util.List removedNodes
List of nodes that have been removed by the transaction

Constructor Detail

TransactionEntry

public TransactionEntry()
Constructs a new TransactionEntry.

Method Detail

addModification

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


addCacheLoaderModification

public void addCacheLoaderModification(org.jgroups.blocks.MethodCall m)

getModifications

public java.util.List getModifications()
Returns all modifications.


getCacheLoaderModifications

public java.util.List getCacheLoaderModifications()

addUndoOperation

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

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

addRemovedNode

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

Parameters:
fqn -

getRemovedNodes

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


getUndoOperations

public java.util.List 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(IdentityLock l)
Adds a lock to the end of the lock list.


addLocks

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

Parameters:
newLocks - Collection

getLocks

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

Returns:
a defensive copy of the internal data structure.

releaseAllLocks

public void releaseAllLocks(java.lang.Object owner)
Deprecated. don't think this is used anymore

Calls releaseAllLocksFIFO(java.lang.Object).


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.


undoOperations

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


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 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



Copyright © 1998-2005 JBoss Inc . All Rights Reserved.