摘要: 大家知道,lucene中的IndexWriter和IndexReader都是线程安全的类,但是不能出现多多线程绑定多个实例的情况。因此很有必要保证IndexWriter和IndexReader全局只有一个实例子。我们首先写一个类,让他来保证全局只有一个实例,类的接口如下:1 public interface LuceneManager {2 public IndexWriter getIndexWriter() throws CorruptIndexException, LockObtainFailedException, IOException;3 public Inde... 阅读全文
posted @ 2012-02-20 11:07 李克华 阅读(8004) 评论(8) 推荐(2)