private static void configureServer(Server server) { server.addLifecycleListener(new JreMemoryLeakPreventionListener()); server.addLifecycleListener(new ThreadLocalLeakPreventionListener()); }
@Override public void accept(final Tomcat tomcat) { tomcat.getServer().addLifecycleListener(this); }
/** * @param context * @param contextConfiguration */ private void attachRequestListener(final ApplicationContextFacade context, final BaseContextConfiguration contextConfiguration) { tomcat.getServer().addLifecycleListener(new LifecycleListener() { @Override public void lifecycleEvent(LifecycleEvent event) { log.info("LOG00420: event.type={}", event.getType()); if (event.getType().equals(Lifecycle.BEFORE_START_EVENT)) { CallbackRequestEventListener requestEventListener = new CallbackRequestEventListener(configuration); context.addListener(requestEventListener); contextConfiguration.setRequestEventListener(requestEventListener); } } }); }
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()); }
server.addLifecycleListener(new NamingContextListener());
server.addLifecycleListener(new NamingContextListener());
server.addLifecycleListener(new NamingContextListener());
server.addLifecycleListener(new NamingContextListener());
server.addLifecycleListener(new NamingContextListener());
server.addLifecycleListener(new NamingContextListener());
server.addLifecycleListener(new NamingContextListener());
server.addLifecycleListener(new NamingContextListener());
private void waitForTomcatLifecycleState(LifecycleState s) throws InterruptedException { final Object mutex = new Object(); final LifecycleState state = s; tomcat.getServer().addLifecycleListener(new LifecycleListener() { @Override public void lifecycleEvent(LifecycleEvent event) { if (event.getLifecycle().getState() == state) { synchronized (mutex) { tomcat.getServer().removeLifecycleListener(this); mutex.notify(); } } } }); synchronized (mutex) { while (tomcat.getServer().getState() != state) mutex.wait(); } }
@Override public void start() { Server server = this.serverProvider.getServer(); if (server == null) throw new IllegalStateException(); if (!this.containsListener(server)) { server.addLifecycleListener(this); } if (this.init.compareAndSet(false, true)) { this.init(server); } if (this.start.compareAndSet(false, true)) { this.eventHandler.start(this.factory.createServer(server)); } }
tomcat.getServer().addLifecycleListener(this);
tomcat.getServer().addLifecycleListener(aprLifecycleListener); context.addLifecycleListener(aprLifecycleListener); if (AprLifecycleListener.isAprAvailable()) {
/** * Fires the embedded tomcat that is assumed to be fully configured. * * @throws LifecycleException if tomcat failed to start */ private void doStart() throws LifecycleException { tomcat.getServer().addLifecycleListener(new TomcatLifecycleListener()); logger.info("Deploying application to [" + getConfig().getDeployUrl() + "]"); tomcat.start(); // Let's set the port that was used to actually start the application if necessary if (getConfig().getPort() == EmbedVaadinConfig.DEFAULT_PORT) { getConfig().setPort(getTomcat().getConnector().getLocalPort()); } logger.info("Application has been deployed to [" + getConfig().getDeployUrl() + "]"); if (config.shouldOpenBrowser()) { BrowserUtils.openBrowser(getConfig().getOpenBrowserUrl()); } if (isWaiting()) { tomcat.getServer().await(); } }
this.tomcat.getServer().addLifecycleListener(new AprLifecycleListener()); .addLifecycleListener(new GlobalResourcesLifecycleListener()); server.addLifecycleListener(new JreMemoryLeakPreventionListener()); server.addLifecycleListener(new ThreadLocalLeakPreventionListener());