try {
ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
DbForumFactory dbForumFactory = null;
dbForumFactory = (DbForumFactory)((ForumFactoryProxy)forumFactory).getUnderlyingForumFactory();
DbCacheManager cacheManager = dbForumFactory.getCacheManager();
//action
if(request.getParameter("switchcache")!=null){
cacheManager.setCacheEnabled(!cacheManager.isCacheEnabled());
}
if(request.getParameter("clean")!=null){
try {
cacheManager.clear(Integer.parseInt(request.getParameter("clean")));
} catch (Exception e) {
}
}
if(request.getParameter("newSize")!=null){
try {
Cache cache = cacheManager.getCache(Integer.parseInt(request.getParameter("oid")));
cache.setMaxSize(Integer.parseInt(request.getParameter("newSize"))*1024);
} catch (Exception e) {
}
}
//init
List mcos =new ArrayList(5);
for(int i =0;i<ctes.length;i++){
mcos.add(new CacheBean(ctes[i], "cache.memory.ctes."+(i+1),cacheManager.getCache(ctes[i])));
}
request.setAttribute("mcos",mcos);
request.setAttribute("isCacheEnabled",new Boolean(cacheManager.isCacheEnabled()));
} catch (Exception e) {
String eid=this.getClass().getName()+"_"+System.currentTimeMillis();
log.error("eid:"+eid +"\nsessionID" +request.getSession().getId(),e) ;
errors.add("general", new ActionError("error.general","error id:"+eid));