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 Object

Information associated with a GlobalTransaction about the transaction state.

A TransactionEntry maintains:

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

Constructor Summary
TransactionEntry(Transaction tx)
           
 
Method Summary
 void addCacheLoaderModification(ReversibleCommand command)
           
 void addLock(NodeLock l)
          Adds a lock to the end of the lock list, if it isn't already present.
 void addLocks(Collection<NodeLock> newLocks)
          Add multiple locks to the lock list.
 void addModification(ReversibleCommand command)
          Adds a modification to the modification list.
 void addRemovedNode(Fqn fqn)
          Adds the node that has been removed.
 List<ReversibleCommand> getCacheLoaderModifications()
           
 List<Fqn> getDummyNodesCreatedByCacheLoader()
           
 List<NodeLock> getLocks()
          Returns the locks in use.
 List<ReversibleCommand> 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 TransactionEntry
 boolean hasModifications()
          Returns true if modifications were registered to either modificationList or to class loader modifications list.
 boolean isForceAsyncReplication()
          Gets the value of the forceAsyncReplication flag.
 boolean isForceSyncReplication()
          Gets the value of the forceSyncReplication flag.
 void loadUninitialisedNode(Fqn fqn)
           
 void releaseAllLocksFIFO(Object owner)
          Releases all locks held by the owner, in order of creation.
 void releaseAllLocksLIFO(Object owner)
          Releases all locks held by the owner, in reverse order of creation.
 void reset()
          Cleans up internal state
 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)
           
 void setTransaction(Transaction tx)
          Sets the local transaction for this entry.
 String toString()
          Returns debug information about this transaction.
 void undoOperations()
          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(Transaction tx)
                 throws SystemException,
                        RollbackException
Throws:
SystemException
RollbackException
Method Detail

addModification

public void addModification(ReversibleCommand command)
Adds a modification to the modification list.


addCacheLoaderModification

public void addCacheLoaderModification(ReversibleCommand command)

getModifications

public List<ReversibleCommand> getModifications()
Returns all modifications.


getCacheLoaderModifications

public List<ReversibleCommand> getCacheLoaderModifications()

addRemovedNode

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

Parameters:
fqn -

getRemovedNodes

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


setTransaction

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


getTransaction

public 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(Collection<NodeLock> newLocks)
Add multiple locks to the lock list.

Parameters:
newLocks - Collection

getLocks

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

Returns:
a defensive copy of the internal data structure.

releaseAllLocksLIFO

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


releaseAllLocksFIFO

public void releaseAllLocksFIFO(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. Also used by OptimisticReplicationInterceptor when dealing with Option.setForceAsynchronous(boolean) in a non-transactional context (i.e. with an implicit transaction).

Parameters:
forceAsyncReplication - value of forceAsyncReplication

isForceSyncReplication

public boolean isForceSyncReplication()
Gets the value of the forceSyncReplication 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.

setForceSyncReplication

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

Parameters:
forceSyncReplication - value of forceSyncReplication

undoOperations

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


toString

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

Overrides:
toString in class Object

loadUninitialisedNode

public void loadUninitialisedNode(Fqn fqn)

getDummyNodesCreatedByCacheLoader

public 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


getOrderedSynchronizationHandler

public OrderedSynchronizationHandler getOrderedSynchronizationHandler()

setOrderedSynchronizationHandler

public void setOrderedSynchronizationHandler(OrderedSynchronizationHandler orderedSynchronizationHandler)

hasModifications

public boolean hasModifications()
Returns true if modifications were registered to either modificationList or to class loader modifications list.


reset

public void reset()
Cleans up internal state



Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.