smurf
This commit is contained in:
parent
c1de65447e
commit
3b6bcafca3
1 changed files with 8 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue