@Override public Void call() throws Exception { holder.stop(); return null; }
private void clean() { if (commandServlet != null) { try { commandServlet.stop(); } catch (Exception ex) { } } }
public void stopRESTService(RESTConsumesConfiguration consumesConfig) throws PEtALSCDKException { ServletHolder servletHolderToStop = getServletHolder(consumesConfig); try { servletHolderToStop.stop(); } catch (Exception e) { throw new PEtALSCDKException(e); } }
private static final void addRESTServlet(Logger logger, ServletContextHandler servletContextHandler, String serviceBasePath, RESTServlet restServlet) { ServletHolder servletHolder = new ServletHolder(restServlet); String pathSpec; if (serviceBasePath.endsWith("/")) { pathSpec = serviceBasePath + "*"; } else if (!serviceBasePath.endsWith("/*")) { pathSpec = serviceBasePath + "/*"; } else { pathSpec = serviceBasePath; } servletContextHandler.addServlet(servletHolder, pathSpec); // if the server is already running, it will start the servlet holder // so we must stop it now (it is not possible to prevent the starting from happening apparently...) if (servletHolder.isRunning()) { try { servletHolder.stop(); } catch (Exception e) { String servletName = restServlet.getServletConfig().getServletName(); // normally, this will NEVER happen logger.log(Level.WARNING, String.format("Can't stop REST servlet '%s' ('%s') during SU deploy", servletName, pathSpec), e); } } if (logger.isLoggable(Level.FINEST)) { String servletName = restServlet.getServletConfig().getServletName(); logger.log(Level.FINEST, String.format("REST servlet '%s' ('%s') added", servletName, pathSpec)); } }
@Override protected synchronized void doStop() throws Exception { super.doStop(); // Stop filters if (_filters!=null) { for (int i=_filters.length; i-->0;) { try { _filters[i].stop(); }catch(Exception e){LOG.warn(Log.EXCEPTION,e);} } } // Stop servlets if (_servlets!=null) { for (int i=_servlets.length; i-->0;) { try { _servlets[i].stop(); }catch(Exception e){LOG.warn(Log.EXCEPTION,e);} } } _filterPathMappings=null; _filterNameMappings=null; _servletPathMap=null; }
@Override protected synchronized void doStop() throws Exception { super.doStop(); // Stop filters if (_filters!=null) { for (int i=_filters.length; i-->0;) { try { _filters[i].stop(); }catch(Exception e){LOG.warn(Log.EXCEPTION,e);} } } // Stop servlets if (_servlets!=null) { for (int i=_servlets.length; i-->0;) { try { _servlets[i].stop(); }catch(Exception e){LOG.warn(Log.EXCEPTION,e);} } } _filterPathMappings=null; _filterNameMappings=null; _servletPathMap=null; }
try { _servlets[i].stop(); }catch(Exception e){LOG.warn(Log.EXCEPTION,e);} if (_servlets[i].getSource() != Source.EMBEDDED)
try { _servlets[i].stop(); }catch(Exception e){LOG.warn(Log.EXCEPTION,e);} if (_servlets[i].getSource() != Source.EMBEDDED)
try { _servlets[i].stop(); }catch(Exception e){LOG.warn(Log.EXCEPTION,e);} if (_servlets[i].getSource() != Source.EMBEDDED)
_servlets[i].stop();
_servlets[i].stop();
holder.stop();
holder.stop();