org.jboss.ejb.plugins.lock
Class NonReentrantLock
java.lang.Object
org.jboss.ejb.plugins.lock.NonReentrantLock
- All Implemented Interfaces:
- Resource (src)
- public class NonReentrantLock
- extends java.lang.Object
- implements Resource (src)
Implementents a non reentrant lock with deadlock detection
It will throw a ReentranceException if the same thread tries to acquire twice
or the same transaction tries to acquire twice
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lockHolder
protected java.lang.Thread lockHolder
lock
protected java.lang.Object lock
held
protected volatile int held
holdingTx
protected Transaction (src) holdingTx
NonReentrantLock
public NonReentrantLock()
getResourceHolder
public java.lang.Object getResourceHolder()
- Specified by:
getResourceHolder
in interface Resource (src)
acquireNonReentrant
protected boolean acquireNonReentrant(long waitTime,
Transaction (src) miTx)
throws ApplicationDeadlockException (src) ,
java.lang.InterruptedException,
NonReentrantLock.ReentranceException (src)
- Throws:
ApplicationDeadlockException (src)
java.lang.InterruptedException
NonReentrantLock.ReentranceException (src)
acquireReentrant
protected boolean acquireReentrant(long waitTime,
Transaction (src) miTx)
throws ApplicationDeadlockException (src) ,
java.lang.InterruptedException,
NonReentrantLock.ReentranceException (src)
- Throws:
ApplicationDeadlockException (src)
java.lang.InterruptedException
NonReentrantLock.ReentranceException (src)
attempt
public boolean attempt(long waitTime,
Transaction (src) miTx,
boolean nonReentrant)
throws ApplicationDeadlockException (src) ,
java.lang.InterruptedException,
NonReentrantLock.ReentranceException (src)
- Throws:
ApplicationDeadlockException (src)
java.lang.InterruptedException
NonReentrantLock.ReentranceException (src)
release
public void release(boolean nonReentrant)