KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > snapper > wrapper > lucene > LuceneSearcherFactory


1 /*
2  * Created on Apr 8, 2005
3  *
4  */

5 package org.enhydra.snapper.wrapper.lucene;
6
7 import org.enhydra.snapper.api.*;
8 import org.enhydra.snapper.api.searching.*;
9 import org.enhydra.snapper.api.logging.LoggingManager;
10
11 /**
12  * @author Igor Smirnov
13  */

14 public class LuceneSearcherFactory implements SearcherFactory {
15     
16     protected static LoggingManager logger;
17     Searcher searcher = null;
18
19     /* (non-Javadoc)
20      * @see org.enhydra.snapper.api.indexing.IndexerFactory#configure(org.enhydra.snapper.api.logging.LoggingManager)
21      */

22     public void configure(LoggingManager logger) {
23         LuceneSearcherFactory.logger = logger;
24         try {
25             
26             // Create the value object
27
//objectClass = Class.forName(fullClassName);
28

29             searcher = new LuceneSearcher();
30             //indexer.configure(logger);
31
} catch (Exception JavaDoc ex) {
32             System.out.println("Error on creating Searcher" + ex);
33         }
34
35
36     }
37     
38     public Searcher getSearcher(){
39         return searcher;
40     }
41     
42     public Searcher newSearcher(){
43         searcher = new LuceneSearcher();
44         //indexer.configure(logger);
45
return searcher;
46     }
47     
48     public void removeSearcher(){
49        searcher = null;
50     }
51
52 }
53
Popular Tags