Class EJBReadWriteLock.WriteLock
- java.lang.Object
-
- org.jboss.as.ejb3.component.singleton.EJBReadWriteLock.WriteLock
-
- All Implemented Interfaces:
Serializable,Lock
- Enclosing class:
- EJBReadWriteLock
public class EJBReadWriteLock.WriteLock extends Object implements Lock, Serializable
An implementation of lock which first checks the number ofEJBReadWriteLock.ReadLockheld by this thread. If the thread already holds aEJBReadWriteLock.ReadLock, then this implementation throws anIllegalLoopbackExceptionwhen a lock is requested- Version:
- $Revision: $
- Author:
- Jaikiran Pai
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WriteLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidlock()Ensures that the current thread doesn't hold any read locks.voidlockInterruptibly()Ensures that the current thread doesn't hold any read locks.ConditionnewCondition()Not implementedbooleantryLock()Ensures that the current thread doesn't hold any read locks.booleantryLock(long time, TimeUnit unit)Ensures that the current thread doesn't hold any read locks.voidunlock()This method delegates the call to the internal delegateReentrantReadWriteLock
-
-
-
Method Detail
-
lock
public void lock()
Ensures that the current thread doesn't hold any read locks. If the thread holds any read locks, this method throws aIllegalLoopbackException. If no read locks are held, then this method delegates the call to the internal delegateReentrantReadWriteLock
-
lockInterruptibly
public void lockInterruptibly() throws InterruptedExceptionEnsures that the current thread doesn't hold any read locks. If the thread holds any read locks, this method throws aIllegalLoopbackException. If no read locks are held, then this method delegates the call to the internal delegateReentrantReadWriteLock- Specified by:
lockInterruptiblyin interfaceLock- Throws:
InterruptedException
-
newCondition
public Condition newCondition()
Not implemented- Specified by:
newConditionin interfaceLock- Throws:
UnsupportedOperationException
-
tryLock
public boolean tryLock()
Ensures that the current thread doesn't hold any read locks. If the thread holds any read locks, this method throws aIllegalLoopbackException. If no read locks are held, then this method delegates the call to the internal delegateReentrantReadWriteLock
-
tryLock
public boolean tryLock(long time, TimeUnit unit) throws InterruptedExceptionEnsures that the current thread doesn't hold any read locks. If the thread holds any read locks, this method throws aIllegalLoopbackException. If no read locks are held, then this method delegates the call to the internal delegateReentrantReadWriteLock- Specified by:
tryLockin interfaceLock- Throws:
InterruptedException
-
unlock
public void unlock()
This method delegates the call to the internal delegateReentrantReadWriteLock
-
-