Examples of LifecycleEvent


Examples of org.apache.catalina.LifecycleEvent

        // prevent it from looking ( if it finds one - it'll have dup error )
        config1.setDefaultWebXml(Constants.NoDefaultWebXml);
        listener1[1] = config1;
        // Need to init since context won't call init
        config1.lifecycleEvent(
                new LifecycleEvent(ctx, Lifecycle.AFTER_INIT_EVENT, null));
        Tomcat.addServlet(ctx, "getresource", new GetResourceServlet());
        ctx.addServletMapping("/getresource", "getresource");

        ctx.start();
View Full Code Here

Examples of org.apache.catalina.LifecycleEvent

     * @param type Event type
     * @param data Event data
     */
    public void fireLifecycleEvent(String type, Object data) {

        LifecycleEvent event = new LifecycleEvent(lifecycle, type, data);
        LifecycleListener interested[] = listeners;
        for (int i = 0; i < interested.length; i++)
            interested[i].lifecycleEvent(event);

    }
View Full Code Here

Examples of org.apache.catalina.LifecycleEvent

        filterStop();

        if (isUseNaming()) {
            // Start
            namingContextListener.lifecycleEvent
                (new LifecycleEvent(this, Lifecycle.STOP_EVENT));
        }

        // Binding thread
        unbindThread(oldCCL);

        // Shut down our application class loader
        if ((loader != null) && (loader instanceof Lifecycle)) {
            try {
                ((Lifecycle) loader).stop();
            } catch (LifecycleException e) {
                log(sm.getString("standardContext.stoppingLoader"), e);
            }
        }

        // Binding thread
        oldCCL = bindThread();

        // Restart our application class loader
        if ((loader != null) && (loader instanceof Lifecycle)) {
            try {
                ((Lifecycle) loader).start();
            } catch (LifecycleException e) {
                log(sm.getString("standardContext.startingLoader"), e);
            }
        }

        // Binding thread
        unbindThread(oldCCL);

        // Create and register the associated naming context, if internal
        // naming is used
        boolean ok = true;
        if (isUseNaming()) {
            // Start
            namingContextListener.lifecycleEvent
                (new LifecycleEvent(this, Lifecycle.START_EVENT));
        }

        // Binding thread
        oldCCL = bindThread();
View Full Code Here

Examples of org.apache.catalina.LifecycleEvent

        filterStop();

        if (isUseNaming()) {
            // Start
            namingContextListener.lifecycleEvent
                (new LifecycleEvent(this, Lifecycle.STOP_EVENT));
        }

        // Binding thread
        unbindThread(oldCCL);

        // Shut down our application class loader
        if ((loader != null) && (loader instanceof Lifecycle)) {
            try {
                ((Lifecycle) loader).stop();
            } catch (LifecycleException e) {
                log.error(sm.getString("standardContext.stoppingLoader"), e);
            }
        }

        // Binding thread
        oldCCL = bindThread();

        // Restart our application class loader
        if ((loader != null) && (loader instanceof Lifecycle)) {
            try {
                ((Lifecycle) loader).start();
            } catch (LifecycleException e) {
                log.error(sm.getString("standardContext.startingLoader"), e);
            }
        }

        // Binding thread
        unbindThread(oldCCL);

        // Create and register the associated naming context, if internal
        // naming is used
        boolean ok = true;
        if (isUseNaming()) {
            // Start
            namingContextListener.lifecycleEvent
                (new LifecycleEvent(this, Lifecycle.START_EVENT));
        }

        // Binding thread
        oldCCL = bindThread();
View Full Code Here

Examples of org.apache.catalina.LifecycleEvent

     * @param type Event type
     * @param data Event data
     */
    public void fireLifecycleEvent(String type, Object data) {

        LifecycleEvent event = new LifecycleEvent(lifecycle, type, data);
        LifecycleListener interested[] = null;
        synchronized (listeners) {
            interested = (LifecycleListener[]) listeners.clone();
        }
        for (int i = 0; i < interested.length; i++)
View Full Code Here

Examples of org.apache.catalina.LifecycleEvent

     * @param type Event type
     * @param data Event data
     */
    public void fireLifecycleEvent(String type, Object data) {

        LifecycleEvent event = new LifecycleEvent(lifecycle, type, data);
        LifecycleListener interested[] = null;
        synchronized (listeners) {
            interested = (LifecycleListener[]) listeners.clone();
        }
        for (int i = 0; i < interested.length; i++)
View Full Code Here

Examples of org.apache.catalina.LifecycleEvent

  private static void configureServer(Server server) {
    //server.addLifecycleListener(new SecurityListener());
    //server.addLifecycleListener(new AprLifecycleListener());
    LifecycleListener jasperListener = new JasperListener();
    server.addLifecycleListener(jasperListener);
    jasperListener.lifecycleEvent(new LifecycleEvent(server, Lifecycle.BEFORE_INIT_EVENT, null));
    server.addLifecycleListener(new JreMemoryLeakPreventionListener());
    //server.addLifecycleListener(new GlobalResourcesLifecycleListener());
    server.addLifecycleListener(new ThreadLocalLeakPreventionListener());
  }
View Full Code Here

Examples of org.apache.catalina.LifecycleEvent

        assertEquals(0, webapps().length);
        final StandardHost standardHost = StandardHost.class.cast(TomcatHelper.getServer().findService("Tomcat").getContainer().findChild("localhost"));
        final HostConfig listener = new HostConfig(); // not done in embedded but that's the way autodeploy works in normal tomcat
        standardHost.addLifecycleListener(listener);
        createWebapp(new File(WORK_DIR, "tomee/webapps/my-webapp"));
        listener.lifecycleEvent(new LifecycleEvent(standardHost, Lifecycle.START_EVENT, standardHost));
        assertEquals(1, webapps().length);
        webapps()[0].stop();
        assertEquals(1, webapps().length);
        webapps()[0].start();
        assertEquals(1, webapps().length);
View Full Code Here

Examples of org.apache.catalina.LifecycleEvent

        assertEquals(0, webapps().length);
        final StandardHost standardHost = StandardHost.class.cast(TomcatHelper.getServer().findService("Tomcat").getContainer().findChild("localhost"));
        final HostConfig listener = new HostConfig(); // not done in embedded but that's the way autodeploy works in normal tomcat
        standardHost.addLifecycleListener(listener);
        createWebapp(new File(WORK_DIR, "tomee/webapps/my-webapp"));
        listener.lifecycleEvent(new LifecycleEvent(standardHost, Lifecycle.START_EVENT, standardHost));
        assertEquals(1, webapps().length);
    }
View Full Code Here

Examples of org.apache.catalina.LifecycleEvent

     * @param type Event type
     * @param data Event data
     */
    public void fireLifecycleEvent(String type, Object data) {

        LifecycleEvent event = new LifecycleEvent(lifecycle, type, data);
        LifecycleListener interested[] = null;
        synchronized (listeners) {
            interested = (LifecycleListener[]) listeners.clone();
        }
        for (int i = 0; i < interested.length; i++)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.