org.entityfs.lock.impl
Class SimpleLockAcquiringStrategy

java.lang.Object
  extended by org.entityfs.lock.impl.AbstractLockAcquiringStrategy
      extended by org.entityfs.lock.impl.SimpleLockAcquiringStrategy
All Implemented Interfaces:
LockAcquiringStrategy

public final class SimpleLockAcquiringStrategy
extends AbstractLockAcquiringStrategy
implements LockAcquiringStrategy

This is a simple LockAcquiringStrategy that can wait forever on locks.

In the case of deadlocks, the deadlocked threads will freeze forever. jstack is a good tool for analyzing deadlocks.

Since:
1.0
Author:
Karl Gustafsson
In_jar:
entityfs-core

Field Summary
static SimpleLockAcquiringStrategy INSTANCE
           
 
Constructor Summary
SimpleLockAcquiringStrategy()
           
 
Method Summary
protected  boolean lockIt(Lock l)
          Subclasses implement this to lock the given lock.
 
Methods inherited from class org.entityfs.lock.impl.AbstractLockAcquiringStrategy
getEntityLock, getLock, getReadLock, getWriteLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.entityfs.lock.LockAcquiringStrategy
getEntityLock, getLock, getReadLock, getWriteLock
 

Field Detail

INSTANCE

public static final SimpleLockAcquiringStrategy INSTANCE
Constructor Detail

SimpleLockAcquiringStrategy

public SimpleLockAcquiringStrategy()
Method Detail

lockIt

protected boolean lockIt(Lock l)
Description copied from class: AbstractLockAcquiringStrategy
Subclasses implement this to lock the given lock.

Specified by:
lockIt in class AbstractLockAcquiringStrategy
Parameters:
l - The lock.
Returns:
true if successful, false otherwise. When false is returned, it is interpreted as due to a timeout.