org.infinispan.transaction.xa
Class DeadlockDetectingGlobalTransaction

java.lang.Object
  extended by org.infinispan.transaction.xa.GlobalTransaction
      extended by org.infinispan.transaction.xa.DeadlockDetectingGlobalTransaction
All Implemented Interfaces:
Cloneable

public class DeadlockDetectingGlobalTransaction
extends GlobalTransaction

This class is used when deadlock detection is enabled.

Author:
Mircea.Markus@jboss.com

Nested Class Summary
static class DeadlockDetectingGlobalTransaction.Externalizer
           
 
Field Summary
static boolean trace
           
 
Fields inherited from class org.infinispan.transaction.xa.GlobalTransaction
addr
 
Constructor Summary
DeadlockDetectingGlobalTransaction()
           
 
Method Summary
 boolean equals(Object o)
           
 long getCoinToss()
           
 Object getLockIntention()
          Returns the key this transaction intends to lock.
 int hashCode()
           
 void interruptProcessingThread()
          Tries to interrupt the processing thread.
 boolean isMarkedForRollback()
          Once marked for rollback, the call to interruptProcessingThread() will be ignored.
 boolean isReplicatingTo(Address address)
          Is this global transaction replicating to the given address?
 void setCoinToss(long coinToss)
          Sets the reandom number that defines the coin toss.
 void setLockIntention(Object lockIntention)
          Sets the lock this transaction intends to lock.
 void setMarkedForRollback(boolean markedForRollback)
           
 void setProcessingThread(Thread replicationThread)
          On a node, this will set the thread that handles replicatin on the given node.
 void setReplicatingTo(Set<Address> targets)
          Sets the set og Address objects this node is replicating to.
 boolean thisWillInterrupt(DeadlockDetectingGlobalTransaction globalTransaction)
          Based on the coin toss, determine whether this tx will continue working or this thread will be stopped.
 String toString()
           
 
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

trace

public static final boolean trace
Constructor Detail

DeadlockDetectingGlobalTransaction

public DeadlockDetectingGlobalTransaction()
Method Detail

isReplicatingTo

public boolean isReplicatingTo(Address address)
Is this global transaction replicating to the given address?


setProcessingThread

public void setProcessingThread(Thread replicationThread)
On a node, this will set the thread that handles replicatin on the given node.


interruptProcessingThread

public void interruptProcessingThread()
Tries to interrupt the processing thread.


setReplicatingTo

public void setReplicatingTo(Set<Address> targets)
Sets the set og Address objects this node is replicating to.


thisWillInterrupt

public boolean thisWillInterrupt(DeadlockDetectingGlobalTransaction globalTransaction)
Based on the coin toss, determine whether this tx will continue working or this thread will be stopped.


setCoinToss

public void setCoinToss(long coinToss)
Sets the reandom number that defines the coin toss.


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()
Once marked for rollback, the call to interruptProcessingThread() will be ignored.


setMarkedForRollback

public void setMarkedForRollback(boolean markedForRollback)

getLockIntention

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


setLockIntention

public void setLockIntention(Object lockIntention)
Sets the lock this transaction intends to lock.


Google Analytics

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