Class EJBReadWriteLock.WriteLock
java.lang.Object
org.jboss.as.ejb3.component.singleton.EJBReadWriteLock.WriteLock
- All Implemented Interfaces:
Serializable,Lock
- Enclosing class:
- EJBReadWriteLock
An implementation of lock which first checks the number of
EJBReadWriteLock.ReadLock
held by this thread. If the thread already holds a EJBReadWriteLock.ReadLock, then
this implementation throws an IllegalLoopbackException when a lock
is requested- Version:
- $Revision: $
- Author:
- Jaikiran Pai
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidlock()Ensures that the current thread doesn't hold any read locks.voidEnsures that the current thread doesn't hold any read locks.Not implementedbooleantryLock()Ensures that the current thread doesn't hold any read locks.booleanEnsures that the current thread doesn't hold any read locks.voidunlock()This method delegates the call to the internal delegateReentrantReadWriteLock
-
Constructor Details
-
WriteLock
public WriteLock()
-
-
Method Details
-
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
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- Specified by:
lockInterruptiblyin interfaceLock- Throws:
InterruptedException
-
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
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- Specified by:
tryLockin interfaceLock- Throws:
InterruptedException
-
unlock
public void unlock()This method delegates the call to the internal delegateReentrantReadWriteLock
-