KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > business > search > operations > ReadFromIndexOperation


1
2 package org.roller.business.search.operations;
3
4 import org.apache.commons.logging.Log;
5 import org.apache.commons.logging.LogFactory;
6 import org.roller.business.IndexManagerImpl;
7
8 /**
9  * @author aim4min
10  */

11 public abstract class ReadFromIndexOperation extends IndexOperation
12 {
13
14     /**
15      * @param manager
16      */

17     public ReadFromIndexOperation(IndexManagerImpl mgr)
18     {
19         super(mgr);
20     }
21
22     private static Log mLogger = LogFactory.getFactory().getInstance(
23             ReadFromIndexOperation.class);
24
25     /*
26      * (non-Javadoc)
27      *
28      * @see java.lang.Runnable#run()
29      */

30     public final void run()
31     {
32         try
33         {
34             manager.getReadWriteLock().readLock().acquire();
35             doRun();
36         }
37         catch (InterruptedException JavaDoc e)
38         {
39             mLogger.info("Error acquiring read lock on index", e);
40         }
41         finally
42         {
43             manager.getReadWriteLock().readLock().release();
44         }
45     }
46
47 }
Popular Tags