org.infinispan.transaction.xa
Class DldGlobalTransaction

java.lang.Object
  extended by org.infinispan.transaction.xa.GlobalTransaction
      extended by org.infinispan.transaction.xa.DldGlobalTransaction
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
RecoveryAwareDldGlobalTransaction

public class DldGlobalTransaction
extends GlobalTransaction

This class is used when deadlock detection is enabled.

Author:
Mircea.Markus@jboss.com

Nested Class Summary
static class DldGlobalTransaction.Externalizer
           
 
Nested classes/interfaces inherited from class org.infinispan.transaction.xa.GlobalTransaction
GlobalTransaction.AbstractGlobalTxExternalizer<T extends GlobalTransaction>
 
Field Summary
protected  long coinToss
           
protected  boolean isMarkedForRollback
           
protected  Object localLockIntention
           
protected  Set<Object> locksAtOrigin
           
protected  Collection<Object> remoteLockIntention
           
 
Fields inherited from class org.infinispan.transaction.xa.GlobalTransaction
addr
 
Constructor Summary
DldGlobalTransaction()
           
DldGlobalTransaction(Address addr, boolean remote)
           
 
Method Summary
 boolean equals(Object o)
           
 long getCoinToss()
           
 Object getLockIntention()
          Returns the key this transaction intends to lock.
 Set<Object> getLocksHeldAtOrigin()
           
 Collection<Object> getRemoteLockIntention()
           
 int hashCode()
           
 boolean hasLockAtOrigin(Collection<Object> remoteLockIntention)
           
 boolean isAcquiringRemoteLock(Object key, Address address)
           
 boolean isMarkedForRollback()
           
 void setCoinToss(long coinToss)
          Sets the random number that defines the coin toss.
 void setLockIntention(Object lockIntention)
           
 void setLocksHeldAtOrigin(Set<Object> locksAtOrigin)
           
 void setMarkedForRollback(boolean markedForRollback)
           
 void setRemoteLockIntention(Collection<Object> remoteLockIntention)
           
 String toString()
           
 boolean wouldLose(DldGlobalTransaction other)
           
 
Methods inherited from class org.infinispan.transaction.xa.GlobalTransaction
clone, getAddress, getId, isRemote, setAddress, setId, setRemote
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

coinToss

protected volatile long coinToss

isMarkedForRollback

protected volatile boolean isMarkedForRollback

localLockIntention

protected transient volatile Object localLockIntention

remoteLockIntention

protected volatile Collection<Object> remoteLockIntention

locksAtOrigin

protected volatile Set<Object> locksAtOrigin
Constructor Detail

DldGlobalTransaction

public DldGlobalTransaction()

DldGlobalTransaction

public DldGlobalTransaction(Address addr,
                            boolean remote)
Method Detail

setCoinToss

public void setCoinToss(long coinToss)
Sets the random number that defines the coin toss. A coin toss is a random number that is used when a deadlock is detected for deciding which transaction should commit and which should rollback.


getCoinToss

public long getCoinToss()

equals

public boolean equals(Object o)
Overrides:
equals in class GlobalTransaction

hashCode

public int hashCode()
Overrides:
hashCode in class GlobalTransaction

toString

public String toString()
Overrides:
toString in class GlobalTransaction

isMarkedForRollback

public boolean isMarkedForRollback()

setMarkedForRollback

public void setMarkedForRollback(boolean markedForRollback)

getLockIntention

public Object getLockIntention()
Returns the key this transaction intends to lock.


setLockIntention

public void setLockIntention(Object lockIntention)

wouldLose

public boolean wouldLose(DldGlobalTransaction other)

isAcquiringRemoteLock

public boolean isAcquiringRemoteLock(Object key,
                                     Address address)

setRemoteLockIntention

public void setRemoteLockIntention(Collection<Object> remoteLockIntention)

getRemoteLockIntention

public Collection<Object> getRemoteLockIntention()

hasLockAtOrigin

public boolean hasLockAtOrigin(Collection<Object> remoteLockIntention)

setLocksHeldAtOrigin

public void setLocksHeldAtOrigin(Set<Object> locksAtOrigin)

getLocksHeldAtOrigin

public Set<Object> getLocksHeldAtOrigin()

-->

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