if (server != null && server.isRunning()) {
for (Handler handler : contexts.getChildHandlersByClass(ContextHandler.class)) {
ContextHandler contextHandler = null;
if (handler instanceof ContextHandler) {
contextHandler = (ContextHandler) handler;
Handler jh = contextHandler.getHandler();
if (jh instanceof JettyHTTPHandler
&& contextName.equals(contextHandler.getContextPath())
&& ((JettyHTTPHandler)jh).getName().equals(smap)) {
try {
contexts.removeHandler(handler);