Search in sources :

Example 1 with PussycatManager

use of uk.ac.ebi.spot.goci.pussycat.manager.PussycatManager in project goci by EBISPOT.

the class PussycatAwareHttpSessionListener method sessionDestroyed.

@Override
public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
    HttpSession session = httpSessionEvent.getSession();
    ServletContext servletContext = session.getServletContext();
    WebApplicationContext appContext = (WebApplicationContext) servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
    PussycatManager pussycatManager = appContext.getBean("pussycatManager", PussycatManager.class);
    getLog().debug("HttpSession '" + session.getId() + "' destroyed - attempting to unbind resources");
    boolean unbound = pussycatManager.unbindResources(session);
    getLog().debug("Unbinding resources for HttpSession '" + session.getId() + "' " + (unbound ? "ok" : "failed"));
}
Also used : PussycatManager(uk.ac.ebi.spot.goci.pussycat.manager.PussycatManager) HttpSession(javax.servlet.http.HttpSession) ServletContext(javax.servlet.ServletContext) WebApplicationContext(org.springframework.web.context.WebApplicationContext)

Aggregations

ServletContext (javax.servlet.ServletContext)1 HttpSession (javax.servlet.http.HttpSession)1 WebApplicationContext (org.springframework.web.context.WebApplicationContext)1 PussycatManager (uk.ac.ebi.spot.goci.pussycat.manager.PussycatManager)1