1 19 20 package org.netbeans.modules.retouche.source.usages; 21 import javax.management.NotCompliantMBeanException ; 22 import javax.management.StandardMBean ; 23 import org.apache.lucene.index.IndexWriter; 24 import org.openide.ErrorManager; 25 26 35 public class LuceneIndexMBeanImpl extends StandardMBean implements LuceneIndexMBean { 36 37 private static LuceneIndexMBeanImpl instance; 38 39 private int mergeFactor = IndexWriter.DEFAULT_MERGE_FACTOR; 40 private int maxMergeDocs = IndexWriter.DEFAULT_MAX_MERGE_DOCS; 41 private int maxBufferedDocs = IndexWriter.DEFAULT_MAX_BUFFERED_DOCS; 42 43 private LuceneIndexMBeanImpl () throws NotCompliantMBeanException { 44 super (LuceneIndexMBean.class); 45 } 46 47 public int getMergeFactor () { 48 return this.mergeFactor; 49 } 50 51 public void setMergeFactor (int mf) { 52 this.mergeFactor = mf; 53 } 54 55 public int getMaxMergeDocs () { 56 return this.maxMergeDocs; 57 } 58 59 public void setMaxMergeDocs (int nd) { 60 this.maxMergeDocs = nd; 61 } 62 63 public int getMaxBufferedDocs () { 64 return this.maxBufferedDocs; 65 } 66 67 public void setMaxBufferedDocs (int nd) { 68 this.maxBufferedDocs = nd; 69 } 70 71 public static synchronized LuceneIndexMBeanImpl getDefault () { 72 if (instance == null) { 73 try { 74 instance = new LuceneIndexMBeanImpl (); 75 } catch (NotCompliantMBeanException e) { 76 ErrorManager.getDefault().notify(e); 77 } 78 } 79 return instance; 80 } 81 82 } 83 | Popular Tags |