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 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 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 a IllegalLoopbackException. If no read locks are held, then this method delegates the call to the internal delegate ReentrantReadWriteLock
      Specified by:
      lock in interface Lock
    • lockInterruptibly

      public void lockInterruptibly() throws InterruptedException
      Ensures that the current thread doesn't hold any read locks. If the thread holds any read locks, this method throws a IllegalLoopbackException. If no read locks are held, then this method delegates the call to the internal delegate ReentrantReadWriteLock
      Specified by:
      lockInterruptibly in interface Lock
      Throws:
      InterruptedException
    • newCondition

      public Condition newCondition()
      Not implemented
      Specified by:
      newCondition in interface Lock
      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 a IllegalLoopbackException. If no read locks are held, then this method delegates the call to the internal delegate ReentrantReadWriteLock
      Specified by:
      tryLock in interface Lock
    • tryLock

      public boolean tryLock(long time, TimeUnit unit) throws InterruptedException
      Ensures that the current thread doesn't hold any read locks. If the thread holds any read locks, this method throws a IllegalLoopbackException. If no read locks are held, then this method delegates the call to the internal delegate ReentrantReadWriteLock
      Specified by:
      tryLock in interface Lock
      Throws:
      InterruptedException
    • unlock

      public void unlock()
      This method delegates the call to the internal delegate ReentrantReadWriteLock
      Specified by:
      unlock in interface Lock