org.apache.lucene.store
Class DirectoryTemplate

java.lang.Object
  extended by org.apache.lucene.store.DirectoryTemplate

public class DirectoryTemplate
extends Object

A simple directory template for performing operations that result in actions being performed on the directory (like index reader/searcher/writer operation). Helps in having the same code base when working with different implementation of Lucene Directory, or switching between un-managed and managed transactions with JdbcDirectory.

Will work with any type of Directory implementation. Special actions will be taken if the JdbcDirectory is used, where DataSourceUtils.commitConnectionIfPossible(java.sql.Connection) will be called after the callback method.

Author:
kimchy

Nested Class Summary
static interface DirectoryTemplate.DirectoryCallback
           
static class DirectoryTemplate.DirectoryCallbackWithoutResult
           
 
Constructor Summary
DirectoryTemplate(Directory dir)
           
 
Method Summary
 void execute(DirectoryTemplate.DirectoryCallback callback)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryTemplate

public DirectoryTemplate(Directory dir)
Method Detail

execute

public void execute(DirectoryTemplate.DirectoryCallback callback)
             throws IOException
Throws:
IOException


Copyright (c) 2004-2008 The Compass Project.