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: 6072 $
Author:
Bela Ban Apr 14, 2003

Constructor Summary
TransactionEntry(Transaction tx)
           
 
Method Summary
 void addLocalModification(ReversibleCommand command)
          Adds a modification to the local modification list.
 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<Fqn> getDummyNodesCreatedByCacheLoader()
           
 List<ReversibleCommand> getLocalModifications()
          Returns all modifications that have been invoked with the LOCAL cache mode option.
 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 hasLocalModifications()
           
 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 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.


getModifications

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


addLocalModification

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


getLocalModifications

public List<ReversibleCommand> getLocalModifications()
Returns all modifications that have been invoked with the LOCAL cache mode option. These will also be in the standard modification list.


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.

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.


hasLocalModifications

public boolean hasLocalModifications()
Returns:
true if any modifications have been invoked with cache mode being LOCAL.

reset

public void reset()
Cleans up internal state



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