org.apache.lucene.util
Class DummyConcurrentLock

java.lang.Object
  extended by org.apache.lucene.util.DummyConcurrentLock
All Implemented Interfaces:
Lock

public final class DummyConcurrentLock
extends Object
implements Lock

A dummy lock as a replacement for ReentrantLock to disable locking


Field Summary
static DummyConcurrentLock INSTANCE
          a default instance, can be always used, as this Lock is stateless.
 
Constructor Summary
DummyConcurrentLock()
           
 
Method Summary
 void lock()
           
 void lockInterruptibly()
           
 Condition newCondition()
           
 boolean tryLock()
           
 boolean tryLock(long time, TimeUnit unit)
           
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DummyConcurrentLock INSTANCE
a default instance, can be always used, as this Lock is stateless.

Constructor Detail

DummyConcurrentLock

public DummyConcurrentLock()
Method Detail

lock

public void lock()
Specified by:
lock in interface Lock

lockInterruptibly

public void lockInterruptibly()
Specified by:
lockInterruptibly in interface Lock

tryLock

public boolean tryLock()
Specified by:
tryLock in interface Lock

tryLock

public boolean tryLock(long time,
                       TimeUnit unit)
Specified by:
tryLock in interface Lock

unlock

public void unlock()
Specified by:
unlock in interface Lock

newCondition

public Condition newCondition()
Specified by:
newCondition in interface Lock


Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.