/** * Stops the embedded Tomcat server. */ public void stopContainer() { try { if (container != null) { container.stop(); logger.info("Stopped container"); } } catch (LifecycleException exception) { logger.warn("Cannot Stop Tomcat" + exception.getMessage()); } }
logger.warn("Cannot Stop Tomcat" + exception.getMessage());
protected void stop(final Embedded server) { try { server.stop(); } catch (LifecycleException e) { throw new RuntimeException(e.getMessage(), e); } finally { if (stop != null) stop.countDown(); stop = null; serverThread = null; } }
@Override public void run() { try { server.start(); startupComplete.countDown(); stop.await(); } catch (LifecycleException e) { throw new RuntimeException(e.getMessage(), e); } catch (InterruptedException ignored) { } finally { serverThread = null; stop = null; } } };
@Override public void run() { try { server.start(); startupComplete.countDown(); stop.await(); } catch (LifecycleException e) { throw new RuntimeException(e.getMessage(), e); } catch (InterruptedException ignored) { } finally { serverThread = null; stop = null; } } };
public void run() { try { if (tomcat != null) { tomcat.getServer().stop(); } } catch (LifecycleException exception) { throw new RuntimeException("WARNING: Cannot Stop Tomcat " + exception.getMessage(), exception); } } });
public void run() { try { if (tomcat != null) { tomcat.getServer().stop(); } } catch (LifecycleException exception) { throw new RuntimeException("WARNING: Cannot Stop Tomcat " + exception.getMessage(), exception); } } });
private void stopCacheManager(WebModule webModule) { ServletContext ctxt = webModule.getServletContext(); CacheManager cm = (CacheManager)ctxt.getAttribute( CacheManager.CACHE_MANAGER_ATTR_NAME); if (cm != null) { try { cm.stop(); if (_logger.isLoggable(Level.FINE)) { _logger.fine("Cache Manager stopped"); } ctxt.removeAttribute(CacheManager.CACHE_MANAGER_ATTR_NAME); } catch (LifecycleException ee) { _logger.log(Level.WARNING, ee.getMessage(), ee.getCause()); } } }
protected void stop(final Tomcat server) { try { server.stop(); server.getConnector().destroy(); } catch (LifecycleException e) { throw new RuntimeException(e.getMessage(), e); } finally { if (stop != null) stop.countDown(); stop = null; serverThread = null; } }
/** * Gracefully terminate the active use of the public methods of this * component. This method should be the last one called on a given * instance of this component. * * @throws IllegalStateException if this component has not been started * @throws LifecycleException if this component detects a fatal error * that needs to be reported */ public void stop() throws LifecycleException { // Validate and update our current component state if (!_started) { String msg = rb.getString("webcontainer.notStarted"); throw new LifecycleException(msg); } _started = false; // stop the embedded container try { _embedded.stop(); } catch (LifecycleException ex) { if (!ex.getMessage().contains("has not been started")) { throw ex; } } }
@Override public void stopServer() { if (tomcat == null) { return; } try { // Stop server tomcat.stop(); LOG.info("Stopped TOMCAT."); // Wait till server stopped waitForTomcatToStop(); tomcat.destroy(); tomcat = null; } catch (LifecycleException e) { LOG.error("Could not STOP LDE TOMCAT server. " + e.getMessage(), e); } }
private void startCacheManager(WebModule webModule) { SunWebApp bean = webModule.getIasWebAppConfigBean(); // Configure the cache, cache-mapping and other settings if (bean != null) { CacheManager cm = null; try { cm = CacheModule.configureResponseCache(webModule, bean); } catch (Exception ee) { _logger.log(Level.WARNING, "webmodule.listener.cachemgrException", ee); } if (cm != null) { try { // first start the CacheManager, if enabled cm.start(); if (_logger.isLoggable(Level.FINE)) { _logger.fine("Cache Manager started"); } // set this manager as a context attribute so that // caching filters/tags can find it ServletContext ctxt = webModule.getServletContext(); ctxt.setAttribute(CacheManager.CACHE_MANAGER_ATTR_NAME, cm); } catch (LifecycleException ee) { _logger.log(Level.WARNING, ee.getMessage(), ee.getCause()); } } } }