Example usage for javax.servlet ServletContextEvent getServletContext

List of usage examples for javax.servlet ServletContextEvent getServletContext

Introduction

In this page you can find the example usage for javax.servlet ServletContextEvent getServletContext.

Prototype

public ServletContext getServletContext() 

Source Link

Document

Return the ServletContext that changed.

Usage

From source file:com.legstar.host.servlet.ContextListener.java

/** {@inheritDoc}*/
public void contextDestroyed(final ServletContextEvent event) {
    ServletContext context = event.getServletContext();
    EngineHandler engineHandler = (EngineHandler) context.getAttribute(InitiatorServlet.ENGINE_HANDLER_ID);
    if (engineHandler != null) {
        engineHandler.stop();/*from   w w w  .j  av a2 s.c o m*/
    }
    _log.info("LegStar engine context destroyed");
}

From source file:com.excilys.ebi.utils.spring.log.logback.web.LogbackConfigListener.java

/**
 * {@inheritDoc}
 */
public void contextInitialized(ServletContextEvent event) {
    LogbackWebConfigurer.initLogging(event.getServletContext());
}

From source file:grails.plugins.jaxrs.web.JaxrsListener.java

public void contextDestroyed(ServletContextEvent event) {
    JaxrsUtils.getRequiredJaxrsContext(event.getServletContext()).destroy();
}

From source file:nl.opengeogroep.filesetsync.server.ServerSyncConfig.java

@Override
public void contextInitialized(ServletContextEvent sce) {
    load(sce.getServletContext().getInitParameter("filesets"));
}

From source file:com.smartitengineering.util.bean.spring.ClasspathXmlContextLoader.java

public void contextInitialized(ServletContextEvent sce) {
    final String classpathAppContextLocation = sce.getServletContext()
            .getInitParameter("classpathAppContextLocation");
    applicationContext = new ClassPathXmlApplicationContext(classpathAppContextLocation);
}

From source file:org.osaf.cosmo.db.DbListener.java

/**
 * Resolves dependencies using the Spring
 * <code>WebApplicationContext</code> and performs startup
 * maintenance tasks.// w  ww  . ja va 2 s .  co m
 */
public void contextInitialized(ServletContextEvent sce) {
    ServletContext sc = sce.getServletContext();
    WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(sc);

    DbInitializer initializer = (DbInitializer) wac.getBean(BEAN_DB_INITIALIZER, DbInitializer.class);
    initializer.initialize();
}

From source file:com.almende.eve.deploy.EveListener.java

@Override
public void contextInitialized(ServletContextEvent sce) {
    final ServletContext sc = sce.getServletContext();

    // Get the eve.yaml file:
    String path = sc.getInitParameter("eve_config");
    if (path != null && !path.isEmpty()) {
        final String fullname = "/WEB-INF/" + path;
        LOG.info("loading configuration file '" + sc.getRealPath(fullname) + "'...");
        final InputStream is = sc.getResourceAsStream(fullname);
        if (is == null) {
            LOG.warning("Can't find the given configuration file:" + sc.getRealPath(fullname));
            return;
        }//from  w  w w  . ja  v  a  2  s .  c  om

        myConfig = Boot.boot(is);
    }

}

From source file:com.excilys.ebi.utils.spring.log.logback.web.LogbackConfigListener.java

/**
 * {@inheritDoc}// w  w w . j  a  v a 2 s . c  o  m
 */
public void contextDestroyed(ServletContextEvent event) {
    LogbackWebConfigurer.shutdownLogging(event.getServletContext());
}

From source file:com.huateng.startup.listener.ContextLoaderListener.java

public void contextInitialized(ServletContextEvent event) {
    ServletContext context = event.getServletContext();
    WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);
    ContextUtil.setContext(ctx);//from   w ww.  ja  va  2 s.  com
}

From source file:org.urbantower.j4s.EmbeddedJettyContexLoaderListener.java

/**
 * during context initialization is filled servlet context into webapp context
 * wrapper/* w  ww. j a v  a 2 s  .com*/
 * @param event
 */
@Override
public void contextInitialized(ServletContextEvent event) {
    context.setServletContext(event.getServletContext());
    super.contextInitialized(event);
}