org.infinispan.util.concurrent.locks
Class DeadlockDetectingLockManager

java.lang.Object
  extended by org.infinispan.util.concurrent.locks.LockManagerImpl
      extended by org.infinispan.util.concurrent.locks.DeadlockDetectingLockManager
All Implemented Interfaces:
LockManager

public class DeadlockDetectingLockManager
extends LockManagerImpl

Lock manager in charge with processing deadlock detections.

Author:
Mircea.Markus@jboss.com

Field Summary
protected  boolean exposeJmxStats
           
protected  long spinDuration
           
 
Fields inherited from class org.infinispan.util.concurrent.locks.LockManagerImpl
configuration, lockContainer, trace
 
Constructor Summary
DeadlockDetectingLockManager()
           
 
Method Summary
 long getDetectedLocalDeadlocks()
           
 long getDetectedRemoteDeadlocks()
           
 long getLocallyInterruptedTransactions()
           
 long getOverlapWithNotDeadlockAwareLockOwners()
           
 long getTotalNumberOfDetectedDeadlocks()
           
 void init()
           
 boolean lockAndRecord(Object key, InvocationContext ctx)
          Acquires a lock of type lockType, on a specific entry in the cache.
 void resetStatistics()
           
 void setExposeJmxStats(boolean exposeJmxStats)
           
 
Methods inherited from class org.infinispan.util.concurrent.locks.LockManagerImpl
getConcurrencyLevel, getLockAcquisitionTimeout, getNumberOfLocksAvailable, getNumberOfLocksHeld, getOwner, injectDependencies, isLocked, ownsLock, possiblyLocked, printLockInfo, releaseLocks, startLockManager, unlock, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spinDuration

protected volatile long spinDuration

exposeJmxStats

protected volatile boolean exposeJmxStats
Constructor Detail

DeadlockDetectingLockManager

public DeadlockDetectingLockManager()
Method Detail

init

public void init()

lockAndRecord

public boolean lockAndRecord(Object key,
                             InvocationContext ctx)
                      throws InterruptedException
Description copied from interface: LockManager
Acquires a lock of type lockType, on a specific entry in the cache. This method will try for a period of time and give up if it is unable to acquire the required lock. The period of time is specified in Configuration.getLockAcquisitionTimeout().

Specified by:
lockAndRecord in interface LockManager
Overrides:
lockAndRecord in class LockManagerImpl
Parameters:
key - key to lock
ctx - invocation context associated with this invocation
Returns:
true if the lock was acquired, false otherwise.
Throws:
InterruptedException - if interrupted

setExposeJmxStats

public void setExposeJmxStats(boolean exposeJmxStats)

getOverlapWithNotDeadlockAwareLockOwners

public long getOverlapWithNotDeadlockAwareLockOwners()

getLocallyInterruptedTransactions

public long getLocallyInterruptedTransactions()

getDetectedRemoteDeadlocks

public long getDetectedRemoteDeadlocks()

getDetectedLocalDeadlocks

public long getDetectedLocalDeadlocks()

getTotalNumberOfDetectedDeadlocks

public long getTotalNumberOfDetectedDeadlocks()

resetStatistics

public void resetStatistics()

Google Analytics

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