01: package com.technoetic.xplanner.actions.admin;
02:
03: import com.technoetic.xplanner.security.auth.Authorizer;
04: import com.technoetic.xplanner.security.auth.SystemAuthorizer;
05: import com.technoetic.xplanner.util.LogUtil;
06: import com.technoetic.xplanner.db.hibernate.HibernateSessionFilter;
07:
08: import org.apache.log4j.Logger;
09: import org.apache.struts.action.Action;
10: import org.apache.struts.action.ActionForward;
11: import org.apache.struts.action.ActionMapping;
12: import org.apache.struts.action.ActionForm;
13:
14: import javax.servlet.http.HttpServletRequest;
15: import javax.servlet.http.HttpServletResponse;
16:
17: import net.sf.hibernate.SessionFactory;
18:
19: public class InvalidateHibernateCacheAction extends Action {
20: private static final Logger log = LogUtil.getLogger();
21: SessionFactory sessionFactory;
22:
23: public ActionForward execute(ActionMapping mapping,
24: ActionForm form, HttpServletRequest request,
25: HttpServletResponse response) throws Exception {
26: sessionFactory.evictQueries();
27: log.info("hibernate cache cleared");
28: return null;
29: }
30:
31: public void setSessionFactory(SessionFactory sessionFactory) {
32: this.sessionFactory = sessionFactory;
33: }
34: }
|