FileDocCategorySizeDatePackage
SingleInstanceLockFactory.javaAPI DocApache Lucene 2.1.02483Wed Feb 14 10:46:40 GMT 2007org.apache.lucene.store

SingleInstanceLockFactory

public class SingleInstanceLockFactory extends LockFactory
Implements {@link LockFactory} for a single in-process instance, meaning all locking will take place through this one instance. Only use this {@link LockFactory} when you are certain all IndexReaders and IndexWriters for a given index are running against a single shared in-process Directory instance. This is currently the default locking for RAMDirectory.
see
LockFactory

Fields Summary
private HashSet
locks
Constructors Summary
Methods Summary
public voidclearLock(java.lang.String lockName)

    synchronized(locks) {
      if (locks.contains(lockName)) {
        locks.remove(lockName);
      }
    }
  
public org.apache.lucene.store.LockmakeLock(java.lang.String lockName)


      
    // We do not use the LockPrefix at all, because the private
    // HashSet instance effectively scopes the locking to this
    // single Directory instance.
    return new SingleInstanceLock(locks, lockName);