Unregisters servlet from http context.

@throws NullArgumentException if servlet is null
@see WebAppVisitor#visit(WebAppServlet)
431874
public void visit(final WebAppServlet webAppServlet) {
		//CHECKSTYLE:OFF
		NullArgumentException.validateNotNull(webAppServlet, "Web app servlet");
		final String[] aliases = webAppServlet.getAliases();
		if (aliases != null && aliases.length > 0) {
			for (String alias : aliases) {
				try {
					httpService.unregister(alias);
				} catch (Exception ignore) {
					LOG.warn("Unregistration exception. Skipping.", ignore);
				}
			}
		} else {
			LOG.warn("Servlet [" + webAppServlet
					+ "] does not have any alias. Skipped.");
		}
		//CHECKSTYLE:OFF
	}
123369
public static void destroyAppContext(Page page) {
        XmlWebApplicationContext appContext = getAppContext(page);
        
        if (appContext != null) {
            appContext.close();
        }
    }
1110339
private void unregister(String path,ZKMBeanInfo bean) throws JMException {
        if(path==null)
            return;
        if (!bean.isHidden()) {
            MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
            try {
                mbs.unregisterMBean(makeObjectName(path, bean));
            } catch (JMException e) {
                LOG.warn("Failed to unregister MBean " + bean.getName());
                throw e;
            }
        }
    }
1152026
public void removeLifeCycleListener(EventListener listener) {
        if (listener != null) {
            if (listener instanceof javax.servlet.ServletContextListener) {
                // add to the context listener list
                servletContextListeners.remove(listener);
            }
            if (listener instanceof javax.servlet.ServletContextAttributeListener) {
                // add to the context attr listener list
                servletContextLAttrListeners.remove(listener);
            }

            if (listener instanceof javax.servlet.http.HttpSessionListener) {
                // session context currently has no way to remove
                // lifecycle listeners
            }
            
            // For Servlet 3.1 need to ensure we check to see if it is a HttpSessionIdListener
            if (isHttpSessionIdListener(listener)) {
                // session context currently has no way to remove lifecycle listener
            }

            // 2.4 Listeners
            if (listener instanceof javax.servlet.ServletRequestListener) {
                servletRequestListeners.remove(listener);
            }
            if (listener instanceof javax.servlet.ServletRequestAttributeListener) {
                servletRequestLAttrListeners.remove(listener);
            }
        }
    }
214037
public void visit(final WebAppListener webAppListener) {
		NullArgumentException.validateNotNull(webAppListener,
				"Web app listener");
		try {
			final EventListener listener = RegisterWebAppVisitorHS.newInstance(
					EventListener.class, bundleClassLoader,
					webAppListener.getListenerClass());
			webAppListener.setListener(listener);
			webContainer.registerEventListener(listener, httpContext);
			//CHECKSTYLE:OFF
		} catch (Exception ignore) {
			LOG.error(REGISTRATION_EXCEPTION_SKIPPING, ignore);
		}
		//CHECKSTYLE:ON
	}
351842
@Override
	public void unregisterOsgiProvider (Object provider) throws FhirConfigurationException {
		if (null == provider) {
			throw new NullPointerException("FHIR Provider cannot be null");
		}
		try {
			this.serverProviders.remove(provider);
			log.trace("unregistered provider. class ["+provider.getClass().getName()+"]");
			super.unregisterProvider(provider);
		} catch (Exception e) {
			log.error("Error unregistering FHIR Provider", e);
			throw new FhirConfigurationException("Error unregistering FHIR Provider", e);
		}
	}
255850
@Override
	public void registerServlet(final String alias, final Servlet servlet,
								@SuppressWarnings("rawtypes") final Dictionary initParams,
								final HttpContext httpContext) throws ServletException,
			NamespaceException {
		LOG.warn("Http service has already been stopped");
	}
1251612
public static function unregisterInstance(): void
    {
        if (!self::$unregistering && self::$client !== null) {
            self::$unregistering = true;

            if ((self::$client->preparedToSendBuffer ?: '') !== '') {
                self::$client->sendBuffer .= self::$client->preparedToSendBuffer;
            }

            try {
                self::$client->sendBuffer .= self::$client->protocol->getKeepAlive();
                self::$client->protocol->flush();
            } catch (\Throwable $e) {
            }

            // TODO MUST TEST, IT WAS REMOVED FROM FUNCTION
            // BECAUSE IT SIMPLY LOOKS LIKE THE LINES BEFORE
            // ADDED AN IF TO CHECK THE CHANNEL In CASE OF
            //
            if (isset(self::$client->protocol->handler->channel) &&
                false === strpos(get_class(self::getClient()->protocol->handler->channel), '/EmptyChannel/')) {
                try {
                    self::$client->protocol->keepAlive();
                } catch (\Throwable $e) {
                    // silently discard exceptions when unregistering
                }
            }

            self::$client = null;
            self::$instance = null;
            self::$instanceOptionsKey = null;
            self::$unregistering = false;
        }
    }
143857
public void removeFromSession( HttpServletRequest request )
    {
        StorageHandler sh = Handlers.get( getServletContext() ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName =
                ScopedServletUtils.getScopedSessionAttrName( InternalConstants.FACES_BACKING_ATTR, unwrappedRequest );
        
        sh.removeAttribute( rc, attrName );
    }
739862
ServerSessionContext unregisterSession(long sessionId) {
    ServerSessionContext session = sessions.remove(sessionId);
    if (session != null) {
      clients.remove(session.client(), session);
      connections.remove(session.client(), session.getConnection());
    }
    return session;
  }
356956
public void removeHttpSession(HttpSession session) {
		if (session == activeSession) {
			activeSession = null;
		}
		synchronized (this.sessions) {
			this.sessions.remove(session);
		}
		this.model.removeHttpSession(session);
		session.invalidate();
	}
494197
public void visit(final WebApp webApp) {
		//CHECKSTYLE:OFF
		try {
			httpService.unregister("/");
		} catch (Exception ignore) {
			LOG.warn("Unregistration exception. Skipping.", ignore);
		}
		//CHECKSTYLE:ON
	}
1311756
public void visit(final WebApp webApp) {
		bundleClassLoader = new BundleClassLoader(webApp.getBundle());
		httpContext = webApp.getHttpContext();
		// Make sure we stop the context first, so that listeners
		// can be called correctly before removing ann objects
		webContainer.begin(httpContext);
		// unregister war content resources
		//CHECKSTYLE:OFF
		try {
			webContainer.unregister("/");
		} catch (IllegalArgumentException badarg) {
			// Ignore, we haven't registered anything
		} catch (Exception ignore) {
			LOG.warn("Unregistration exception. Skipping.", ignore);
		}
		// unregister welcome files
		try {
			webContainer.unregisterWelcomeFiles(webApp.getWelcomeFiles(), httpContext);
		} catch (IllegalArgumentException badarg) {
			// Ignore, we haven't registered anything
		} catch (Exception ignore) {
			LOG.warn("Unregistration exception. Skipping.", ignore);
		}
		// unregister JSP support
		try {
			webContainer.unregisterJsps(httpContext);
		} catch (IllegalArgumentException | UnsupportedOperationException badarg) {
			// Ignore, we haven't registered anything
		} catch (Exception ignore) {
			LOG.warn("Unregistration exception. Skipping.", ignore);
		}
		//CHECKSTYLE:ON
	}
486617
@MainThread
    private void handleUnRegistration(Object targetObj) {
        if (targetObj == null) {
            throw new NullPointerException("Target cannot be null");
        }

        EventTarget target = null;

        for (Iterator<EventTarget> iterator = targets.iterator(); iterator.hasNext(); ) {
            EventTarget listTarget = iterator.next();
            if (listTarget.targetObj == targetObj) {
                iterator.remove();
                target = listTarget;
                target.targetObj = null;
                break;
            }
        }

        if (target == null) {
            Utils.logE(targetObj, "Was not registered");
        }

        Utils.log(targetObj, "Unregistered");
    }
917877
public void visit(final WebAppFilter webAppFilter) {
		NullArgumentException.validateNotNull(webAppFilter, "Web app filter");
		String filterName = webAppFilter.getFilterName();

		if (filterName != null) {
			//CHECKSTYLE:OFF
			try {
				webContainer.unregisterFilter(filterName);
			} catch (Exception ignore) {
				LOG.warn("Unregistration exception. Skipping.", ignore);
			}
			//CHECKSTYLE:ON
		}
	}
754011
public void accept(final WebAppVisitor visitor) {
		visitor.visit(this); // First do everything else

		for (WebAppListener listener : listeners) {
			visitor.visit(listener);
		}
		if (!filters.isEmpty()) {
			// first visit the filters with a filter mapping in mapping order
			final List<WebAppFilter> remainingFilters = new ArrayList<>(
					filters.values());
			for (String filterName : orderedFilters) {
				final WebAppFilter filter = filters.get(filterName);
				visitor.visit(filter);
				remainingFilters.remove(filter);
			}
			// then visit filters without a mapping order in the order they were
			// added
			for (WebAppFilter filter : remainingFilters) {
				visitor.visit(filter);
			}
		}
		if (!servlets.isEmpty()) {
			for (WebAppServlet servlet : getSortedWebAppServlet()) {
				// Fix for PAXWEB-205
				visitor.visit(servlet);
			}
		}
		if (!constraintsMapping.isEmpty()) {
			for (WebAppConstraintMapping constraintMapping : constraintsMapping) {
				visitor.visit(constraintMapping);
			}

		}

		for (WebAppErrorPage errorPage : errorPages) {
			visitor.visit(errorPage);
		}

		visitor.end();
	}
1058066
public void unregisterMBean(final ObjectName name) throws JMException {
    if ((beanServer != null) &&
        beanServer.isRegistered(name) &&
        registeredMBeanNames.remove(name)) {
      beanServer.unregisterMBean(name);
    }
  }