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 11 public abstract class ReadFromIndexOperation extends IndexOperation 12 { 13 14 17 public ReadFromIndexOperation(IndexManagerImpl mgr) 18 { 19 super(mgr); 20 } 21 22 private static Log mLogger = LogFactory.getFactory().getInstance( 23 ReadFromIndexOperation.class); 24 25 30 public final void run() 31 { 32 try 33 { 34 manager.getReadWriteLock().readLock().acquire(); 35 doRun(); 36 } 37 catch (InterruptedException 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 |