use of org.springframework.web.context.WebApplicationContext in project Activiti by Activiti.
the class WebConfigurer method contextDestroyed.
@Override
public void contextDestroyed(ServletContextEvent sce) {
log.info("Destroying Web application");
WebApplicationContext ac = WebApplicationContextUtils.getRequiredWebApplicationContext(sce.getServletContext());
AnnotationConfigWebApplicationContext gwac = (AnnotationConfigWebApplicationContext) ac;
gwac.close();
log.debug("Web application destroyed");
}
use of org.springframework.web.context.WebApplicationContext in project Asqatasun by Asqatasun.
the class ConfigPropertiesExposerListener method contextInitialized.
@Override
public void contextInitialized(ServletContextEvent sce) {
// TODO add ability to configure non default values via serveltContexParams
ServletContext servletContext = sce.getServletContext();
WebApplicationContext context = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
ExposablePropertyPlaceholderConfigurer configurer = (ExposablePropertyPlaceholderConfigurer) context.getBean(propertiesBeanName);
sce.getServletContext().setAttribute(contextProperty, configurer.getResolvedProps());
}
use of org.springframework.web.context.WebApplicationContext 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"));
}
use of org.springframework.web.context.WebApplicationContext in project symmetric-ds by JumpMind.
the class SymmetricWebServer method getRestService.
public RestService getRestService() {
ServletContext servletContext = getServletContext();
WebApplicationContext rootContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
return rootContext.getBean(RestService.class);
}
use of org.springframework.web.context.WebApplicationContext in project dhis2-core by dhis2.
the class StartupListener method contextInitialized.
// -------------------------------------------------------------------------
// ServletContextListener implementation
// -------------------------------------------------------------------------
@Override
public void contextInitialized(ServletContextEvent event) {
WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(event.getServletContext());
StartupRoutineExecutor startupRoutineExecutor = (StartupRoutineExecutor) applicationContext.getBean(StartupRoutineExecutor.ID);
try {
startupRoutineExecutor.execute();
} catch (Exception ex) {
log.error(DebugUtils.getStackTrace(ex));
throw new RuntimeException("Failed to run startup routines: " + ex.getMessage(), ex);
}
}
Aggregations