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

LockFactory

public abstract class LockFactory extends Object
Base class for Locking implementation. {@link Directory} uses instances of this class to implement locking.

Fields Summary
protected String
lockPrefix
Constructors Summary
Methods Summary
public abstract voidclearLock(java.lang.String lockName)
Attempt to clear (forcefully unlock and remove) the specified lock. Only call this at a time when you are certain this lock is no longer in use.

param
lockName name of the lock to be cleared.

public java.lang.StringgetLockPrefix()
Get the prefix in use for all locks created in this LockFactory.

    return this.lockPrefix;
  
public abstract org.apache.lucene.store.LockmakeLock(java.lang.String lockName)
Return a new Lock instance identified by lockName.

param
lockName name of the lock to be created.

public voidsetLockPrefix(java.lang.String lockPrefix)
Set the prefix in use for all locks created in this LockFactory. This is normally called once, when a Directory gets this LockFactory instance. However, you can also call this (after this instance is assigned to a Directory) to override the prefix in use. This is helpful if you're running Lucene on machines that have different mount points for the same shared directory.


                                                                       
      
    this.lockPrefix = lockPrefix;