1 18 19 package org.apache.roller.util.cache; 20 21 import java.util.Map ; 22 import org.apache.commons.logging.Log; 23 import org.apache.commons.logging.LogFactory; 24 25 26 29 public class LRUCacheFactoryImpl implements CacheFactory { 30 31 private static Log log = LogFactory.getLog(LRUCacheFactoryImpl.class); 32 33 34 protected LRUCacheFactoryImpl() {} 36 37 38 41 public Cache constructCache(Map properties) { 42 43 int size = 100; 44 String id = "unknown"; 45 46 try { 47 size = Integer.parseInt((String ) properties.get("size")); 48 } catch(Exception e) { 49 } 51 52 String cacheId = (String ) properties.get("id"); 53 if(cacheId != null) { 54 id = cacheId; 55 } 56 57 Cache cache = new LRUCacheImpl(id, size); 58 59 log.debug("new cache constructed. size="+size); 60 61 return cache; 62 } 63 64 } 65 | Popular Tags |