Package javax.servlet

Examples of javax.servlet.ServletContextListener


            for (int i = 0; i < listeners.length; i++) {
                int j = (listeners.length - 1) - i;
                if (listeners[j] == null)
                    continue;
                if (listeners[j] instanceof ServletContextListener) {
                    ServletContextListener listener =
                        (ServletContextListener) listeners[j];
                    try {
                        fireContainerEvent("beforeContextDestroyed", listener);
                        listener.contextDestroyed(event);
                        fireContainerEvent("afterContextDestroyed", listener);
                    } catch (Throwable t) {
                        ExceptionUtils.handleThrowable(t);
                        fireContainerEvent("afterContextDestroyed", listener);
                        getLogger().error
View Full Code Here


    {
         httpServer = new Server(port);

        Context c = new Context(httpServer, contextPath, Context.SESSIONS);
        c.addServlet(new ServletHolder(servlet), servletPath);
        c.addEventListener(new ServletContextListener() {
            public void contextInitialized(ServletContextEvent sce)
            {
                sce.getServletContext().setAttribute(MuleProperties.MULE_CONTEXT_PROPERTY, context);
            }
View Full Code Here

        HTTP_PORT = getPorts().get(0);
        httpServer = new Server(HTTP_PORT);

        Context c = new Context(httpServer, "/", Context.SESSIONS);
        c.addServlet(new ServletHolder(new MuleReceiverServlet()), "/services/*");
        c.addEventListener(new ServletContextListener() {
            public void contextInitialized(ServletContextEvent sce)
            {
                sce.getServletContext().setAttribute(MuleProperties.MULE_CONTEXT_PROPERTY, muleContext);
            }

View Full Code Here

    sc.setInitParameter(YanLoader.CONFIG_FILE_PARAM, "/WEB-INF/yancontainer.xml");
    sc.setInitParameter(YanLoader.USE_SPRING, "true");
    verifyListener(sc, "ba");
  }
  private void verifyListener(ServletContext sc, String beanname){
    ServletContextListener listener = new YanLoaderListener();
    ServletContextEvent event = new ServletContextEvent(sc);
    listener.contextInitialized(event);
    final BankAccount acct = verifyBean(sc, beanname);
    listener.contextDestroyed(event);
    assertTrue(acct.isDestroyed());
  }
View Full Code Here

      // notify context listeners
      if (result.listeners != null)
        for (EventListener listener : result.listeners) {
          if (listener instanceof ServletContextListener) {
            final ServletContextListener contListener = (ServletContextListener) listener;
            contListener
                .contextInitialized(new ServletContextEvent(
                    result));
          }
        }
      // process filters
View Full Code Here

        for (int i = 0; i < instances.length; i++) {
            if (instances[i] == null)
                continue;
            if (!(instances[i] instanceof ServletContextListener))
                continue;
            ServletContextListener listener =
                (ServletContextListener) instances[i];
            try {
                fireContainerEvent("beforeContextInitialized", listener);
                listener.contextInitialized(event);
                fireContainerEvent("afterContextInitialized", listener);
            } catch (Throwable t) {
                fireContainerEvent("afterContextInitialized", listener);
                getServletContext().log
                    (sm.getString("standardContext.listenerStart",
View Full Code Here

            int j = (listeners.length - 1) - i;
            if (listeners[j] == null)
                continue;
            if (!(listeners[j] instanceof ServletContextListener))
                continue;
            ServletContextListener listener =
                (ServletContextListener) listeners[j];
            try {
                fireContainerEvent("beforeContextDestroyed", listener);
                listener.contextDestroyed(event);
                fireContainerEvent("beforeContextDestroyed", listener);
            } catch (Throwable t) {
                fireContainerEvent("beforeContextDestroyed", listener);
                getServletContext().log
                    (sm.getString("standardContext.listenerStop",
View Full Code Here

        for (int i = 0; i < instances.length; i++) {
            if (instances[i] == null)
                continue;
            if (!(instances[i] instanceof ServletContextListener))
                continue;
            ServletContextListener listener =
                (ServletContextListener) instances[i];
            try {
                fireContainerEvent("beforeContextInitialized", listener);
                listener.contextInitialized(event);
                fireContainerEvent("afterContextInitialized", listener);
            } catch (Throwable t) {
                fireContainerEvent("afterContextInitialized", listener);
                log(sm.getString("standardContext.listenerStart",
                                 instances[i].getClass().getName()), t);
View Full Code Here

            int j = (listeners.length - 1) - i;
            if (listeners[j] == null)
                continue;
            if (!(listeners[j] instanceof ServletContextListener))
                continue;
            ServletContextListener listener =
                (ServletContextListener) listeners[j];
            try {
                fireContainerEvent("beforeContextDestroyed", listener);
                listener.contextDestroyed(event);
                fireContainerEvent("afterContextDestroyed", listener);
            } catch (Throwable t) {
                fireContainerEvent("afterContextDestroyed", listener);
                log(sm.getString("standardContext.listenerStop",
                                 listeners[j].getClass().getName()), t);
View Full Code Here

        for (int i = 0; i < instances.length; i++) {
            if (instances[i] == null)
                continue;
            if (!(instances[i] instanceof ServletContextListener))
                continue;
            ServletContextListener listener =
                (ServletContextListener) instances[i];
            try {
                fireContainerEvent("beforeContextInitialized", listener);
                listener.contextInitialized(event);
                fireContainerEvent("afterContextInitialized", listener);
            } catch (Throwable t) {
                fireContainerEvent("afterContextInitialized", listener);
                log(sm.getString("standardContext.listenerStart",
                                 instances[i].getClass().getName()), t);
View Full Code Here

TOP

Related Classes of javax.servlet.ServletContextListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.