/** * Stop this Context component. * * @exception LifecycleException if a shutdown error occurs */ @Override public synchronized void stop() throws LifecycleException { stop(false); }
public void preDeregister() throws Exception { if( started ) { try { stop(); } catch( Exception ex ) { log.error( "error stopping ", ex); } } }
public void preDeregister() throws Exception { if( started ) { try { stop(); } catch( Exception ex ) { log.error( "error stopping ", ex); } } }
public synchronized void stop() throws LifecycleException { // Remove the defaultSubject if (defaultSubject != null) { ContextManager.unregisterSubject(defaultSubject); } super.stop(); }
public void removeWsContainer(String path) { if (path == null) return; // assure context root with a leading slash if (!path.startsWith("/")) path = "/" + path; StandardContext context = webserviceContexts.remove(path); try { context.stop(); context.destroy(); } catch (Exception e) { throw new RuntimeException(e); } Host host = (Host) context.getParent(); host.removeChild(context); }
public void preDeregister() throws Exception { if( started ) { try { stop(); } catch( Exception ex ) { CatalinaLogger.CORE_LOGGER.errorStoppingContext(getName(), ex); } } }
/** * {@inheritDoc} */ public void stop() { if (_context != null) { // Destroy the web context unless if it is default if (!_context.getPath().equals("/")) { try { Container container = _context.getParent(); container.removeChild(_context); _context.stop(); _context.destroy(); LOG.info("Destroyed HTTP context " + _context.getPath()); } catch (Exception e) { LOG.error("Unable to destroy web context", e); } } } } }
/** * {@inheritDoc} */ public void stop() { if (_context != null) { // Destroy the web context unless if it is default if (!_context.getPath().equals("/")) { try { Container container = _context.getParent(); container.removeChild(_context); _context.stop(); _context.destroy(); LOG.info("Destroyed HTTP context " + _context.getPath()); } catch (Exception e) { LOG.error("Unable to destroy web context", e); } } } } }
@Override public synchronized void stop() throws Exception { if (_serverContext != null) { // Destroy the web context unless if it is default if (!_serverContext.getPath().equals("/")) { try { Container container = _serverContext.getParent(); container.removeChild(_serverContext); _serverContext.stop(); _serverContext.destroy(); _log.info("Destroyed HTTP context " + _serverContext.getPath()); } catch (Exception e) { ExtensionLogger.ROOT_LOGGER.unableToDestroyWebContext(_contextName, e); } } } }
void unregisterInternal(Registration reg) { StandardContext context = reg.getContext(); try { context.stop(); } catch (LifecycleException e) { WEB_LOGGER.stopContextFailed(e); } try { context.destroy(); } catch (Exception e) { WEB_LOGGER.destroyContextFailed(e); } }
@Override public synchronized void stop() throws Exception { if (_serverContext != null) { // Destroy the web context unless if it is default if (!_serverContext.getPath().equals("/")) { try { Container container = _serverContext.getParent(); container.removeChild(_serverContext); _serverContext.stop(); _serverContext.destroy(); _log.info("Destroyed HTTP context " + _serverContext.getPath()); } catch (Exception e) { ExtensionLogger.ROOT_LOGGER.unableToDestroyWebContext(_contextName, e); } } } }
if (c instanceof StandardContext) { try { ((StandardContext) c).stop(); host.removeChild(c); } catch (Exception e) {
/** * Remove context from the current host. * * @param path * Path */ @Override public void removeContext(String path) { Container[] children = host.findChildren(); for (Container c : children) { if (c instanceof StandardContext && c.getName().equals(path)) { try { ((StandardContext) c).stop(); host.removeChild(c); break; } catch (Exception e) { log.error("Could not remove context: {}", c.getName(), e); } } } IApplicationContext ctx = LoaderBase.removeRed5ApplicationContext(path); if (ctx != null) { ctx.stop(); } else { log.warn("Context could not be stopped, it was null for path: {}", path); } }
stop(); } catch (LifecycleException e) { log.error(sm.getString("standardContext.stoppingContext"), e);
private void stopWebApp(StandardContext context) throws Exception { try { Container container = context.getParent(); container.removeChild(context); context.stop(); } catch (LifecycleException e) { throw MESSAGES.stopContextPhaseFailed(e); } try { context.destroy(); } catch (Exception e) { throw MESSAGES.destroyContextPhaseFailed(e); } }
private static void stopWebApp(StandardContext context) throws Exception { try { Container container = context.getParent(); container.removeChild(context); context.stop(); } catch (LifecycleException e) { throw MESSAGES.stopContextPhaseFailed(e); } try { context.destroy(); } catch (Exception e) { throw MESSAGES.destroyContextPhaseFailed(e); } }
/** * {@inheritDoc} */ public void stop() { if ((_context != null) && _context.isStarted()) { Registry registry = (Registry)_context.getServletContext().getAttribute(Registry.class.getName()); if (registry != null) { // Remove registrations for (Class<?> clazz : _classes) { LOG.debug("Stopping ... " + clazz); registry.removeRegistrations(clazz); } // Destroy the web context unless if it is default if ((registry.getSize() == 0) && (!_context.getPath().equals("/"))) { try { Container container = _context.getParent(); container.removeChild(_context); _context.stop(); _context.destroy(); LOG.info("Destroyed RESTEasy context " + _context.getPath()); } catch (Exception e) { ExtensionLogger.ROOT_LOGGER.unableToDestroyWebContext(_context.getPath(), e); } } } } } }
/** * {@inheritDoc} */ public void stop() { if ((_context != null) && _context.isStarted()) { Registry registry = (Registry)_context.getServletContext().getAttribute(Registry.class.getName()); if (registry != null) { // Remove registrations for (Class<?> clazz : _classes) { LOG.debug("Stopping ... " + clazz); registry.removeRegistrations(clazz); } // Destroy the web context unless if it is default if ((registry.getSize() == 0) && (!_context.getPath().equals("/"))) { try { Container container = _context.getParent(); container.removeChild(_context); _context.stop(); _context.destroy(); LOG.info("Destroyed RESTEasy context " + _context.getPath()); } catch (Exception e) { ExtensionLogger.ROOT_LOGGER.unableToDestroyWebContext(_context.getPath(), e); } } } } } }
public void deactivate(URI uri) throws WebApplicationActivationException { String contextPath = mappings.remove(uri); if (contextPath == null) { throw new WebApplicationActivationException("Context not registered for component: " + uri); } StandardContext context = null; try { for (Container container : connector.getContainer().findChildren()) { if (container instanceof StandardHost) { context = (StandardContext) container.findChild(contextPath); container.removeChild(context); try { context.destroy(); } catch (Exception e) { throw new WebApplicationActivationException(e); } break; } } if (context == null) { throw new WebApplicationActivationException("Context not found for: " + contextPath); } context.stop(); monitor.deactivated(contextPath); } catch (LifecycleException e) { throw new WebApplicationActivationException(e); } }
/** * Reload this web application, if reloading is supported. * <p> * <b>IMPLEMENTATION NOTE</b>: This method is designed to deal with * reloads required by changes to classes in the underlying repositories * of our class loader. It does not handle changes to the web application * deployment descriptor. If that has occurred, you should stop this * Context and create (and start) a new Context instance instead. * * @exception IllegalStateException if the <code>reloadable</code> * property is set to <code>false</code>. */ public synchronized void reload() { // Validate our current component state if (!started) return; // Stop accepting requests temporarily setPaused(true); try { stop(); } catch (LifecycleException e) { CatalinaLogger.CORE_LOGGER.errorStoppingContext(getName(), e); } try { start(); } catch (LifecycleException e) { CatalinaLogger.CORE_LOGGER.errorStartingContext(getName(), e); } setPaused(false); }