1 6 7 package org.roller.business; 8 9 import org.apache.commons.logging.Log; 10 import org.apache.commons.logging.LogFactory; 11 import org.roller.RollerException; 12 import org.roller.config.RollerConfig; 13 import org.roller.model.FileManager; 14 import org.roller.model.IndexManager; 15 import org.roller.model.Roller; 16 import org.roller.model.ThreadManager; 17 import org.roller.util.StringUtils; 18 19 20 27 public abstract class RollerImpl implements Roller { 28 29 private static Log mLogger = 30 LogFactory.getFactory().getInstance(RollerImpl.class); 31 32 protected FileManager mFileManager = null; 33 protected IndexManager mIndexManager = null; 34 protected ThreadManager mThreadManager = null; 35 36 37 38 public RollerImpl() { 39 } 41 42 43 46 public FileManager getFileManager() throws RollerException 47 { 48 if (mFileManager == null) 49 { 50 mFileManager = new FileManagerImpl(); 51 } 52 return mFileManager; 53 } 54 55 58 public ThreadManager getThreadManager() throws RollerException 59 { 60 if (mThreadManager == null) 61 { 62 mThreadManager = new ThreadManagerImpl(); 63 } 64 return mThreadManager; 65 } 66 67 70 public IndexManager getIndexManager() throws RollerException 71 { 72 if (mIndexManager == null) 73 { 74 mIndexManager = new IndexManagerImpl(); 75 } 76 return mIndexManager; 77 } 78 79 80 public void release() 81 { 82 if (mFileManager != null) mFileManager.release(); 83 if (mThreadManager != null) mThreadManager.release(); 84 } 85 86 87 public void shutdown() 88 { 89 try 90 { 91 if (mIndexManager != null) mIndexManager.shutdown(); 92 if (mThreadManager != null) mThreadManager.shutdown(); 93 } 94 catch(Exception e) 95 { 96 mLogger.warn(e); 97 } 98 } 99 } 100 | Popular Tags |