org.apache.solr.core
Class DirectoryFactory

java.lang.Object
  extended by org.apache.solr.core.DirectoryFactory
All Implemented Interfaces:
Closeable, NamedListInitializedPlugin
Direct Known Subclasses:
CachingDirectoryFactory

public abstract class DirectoryFactory
extends Object
implements NamedListInitializedPlugin, Closeable

Provides access to a Directory implementation. You must release every Directory that you get.


Constructor Summary
DirectoryFactory()
           
 
Method Summary
abstract  void close()
          Close the this and all of the Directories it contains.
protected abstract  Directory create(String path)
          Creates a new Directory for a given path.
abstract  boolean exists(String path)
          Returns true if a Directory exists for a given path.
abstract  Directory get(String path, String rawLockType)
          Returns the Directory for a given path, using the specified rawLockType.
abstract  Directory get(String path, String rawLockType, boolean forceNew)
          Returns the Directory for a given path, using the specified rawLockType.
abstract  void incRef(Directory directory)
          Increment the number of references to the given Directory.
abstract  void release(Directory directory)
          Releases the Directory so that it may be closed when it is no longer referenced.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.solr.util.plugin.NamedListInitializedPlugin
init
 

Constructor Detail

DirectoryFactory

public DirectoryFactory()
Method Detail

close

public abstract void close()
                    throws IOException
Close the this and all of the Directories it contains.

Specified by:
close in interface Closeable
Throws:
IOException

create

protected abstract Directory create(String path)
                             throws IOException
Creates a new Directory for a given path.

Throws:
IOException

exists

public abstract boolean exists(String path)
Returns true if a Directory exists for a given path.


get

public abstract Directory get(String path,
                              String rawLockType)
                       throws IOException
Returns the Directory for a given path, using the specified rawLockType. Will return the same Directory instance for the same path.

Throws:
IOException

get

public abstract Directory get(String path,
                              String rawLockType,
                              boolean forceNew)
                       throws IOException
Returns the Directory for a given path, using the specified rawLockType. Will return the same Directory instance for the same path unless forceNew, in which case a new Directory is returned.

Throws:
IOException

incRef

public abstract void incRef(Directory directory)
Increment the number of references to the given Directory. You must call release for every call to this method.


release

public abstract void release(Directory directory)
                      throws IOException
Releases the Directory so that it may be closed when it is no longer referenced.

Throws:
IOException


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