This commit is contained in:
Knut Forkalsrud 2009-01-24 12:00:39 -08:00
parent c1de65447e
commit 3b6bcafca3

View file

@ -40,6 +40,7 @@ public class AlbumServlet
File base; File base;
String basePrefix; String basePrefix;
Cache imageCache; Cache imageCache;
CacheManager cacheManager;
@Override @Override
public void init() public void init()
@ -51,10 +52,16 @@ public class AlbumServlet
PropertyConfigurator.configure("log4j.properties"); PropertyConfigurator.configure("log4j.properties");
LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Log4JLogger"); LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Log4JLogger");
CacheManager cacheManager = new CacheManager(); cacheManager = CacheManager.create();
imageCache = cacheManager.getCache("imageCache"); imageCache = cacheManager.getCache("imageCache");
} }
@Override
public void destroy() {
imageCache.flush();
cacheManager.shutdown();
}
@Override @Override
public void doGet(HttpServletRequest req, HttpServletResponse res) public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException throws ServletException, IOException