* @see org.springmodules.resource.ResourceManager#close()
* @see IndexReaderFactoryUtils#releaseIndexReader(IndexFactory, IndexReader)
* @see IndexWriterFactoryUtils#releaseIndexWriter(IndexFactory, IndexWriter)
*/
public void doClose() {
IndexHolder holder=(IndexHolder)ResourceBindingManager.getResource(this.indexFactory);
// Remove the resource holder from the thread.
ResourceBindingManager.unbindResource(this.indexFactory);
// Close index.
IndexReader indexReader = holder.getIndexReader();
if (logger.isDebugEnabled()) {
logger.debug("Closing Lucene indexReader [" + indexReader + "]");
}
IndexReaderFactoryUtils.releaseIndexReader(this.indexFactory,indexReader);
IndexWriter indexWriter = holder.getIndexWriter();
if (logger.isDebugEnabled()) {
logger.debug("Closing Lucene indexWriter [" + indexWriter + "]");
}
IndexWriterFactoryUtils.releaseIndexWriter(this.indexFactory,indexWriter);
}