/*
(non-Javadoc)
@see net.roboconf.dm.internal.rest.api.IManagementWs
#shutdownApplication(java.lang.String)
186685
@Override
	public Response shutdownApplication( String applicationName ) {

		this.logger.fine( "Request: shutdown application " + applicationName + "." );
		Response result = Response.ok().build();
		try {
			ManagedApplication ma = this.manager.applicationMngr().findManagedApplicationByName( applicationName );
			if( ma == null ) {
				result = handleError(
						Status.NOT_FOUND,
						new RestError( REST_INEXISTING, application( applicationName )),
						lang( this.manager )).build();

			} else {
				this.manager.instancesMngr().undeployAll( ma, null );
			}

		} catch( Exception e ) {
			result = handleError(
					Status.FORBIDDEN,
					new RestError( REST_MNGMT_APP_SHUTDOWN_ERROR, e ),
					lang( this.manager )).build();
		}

		return result;
	}
1206726
@Override
  public void shutdown(DeployService2Impl<I> deploy,
                       ShutdownModeAmp mode,
                       Result<Boolean> result)
  {
    deploy.shutdownImpl(mode, result);
  }
1045866
@Override
  protected void shutDown() throws Exception {
    this.scheduledExecutor.shutdown();
    this.scheduledExecutor.awaitTermination(TERMINATION_TIMEOUT, TimeUnit.SECONDS);
  }
528381
protected void stopProcessApplication(ProcessApplicationReference processApplicationReference) {

    try {
      // unless the user has overridden the stop behavior,
      // this causes the process application to remove its services
      // (triggers nested undeployment operation)
      ProcessApplicationInterface processApplication = processApplicationReference.getProcessApplication();
      processApplication.undeploy();
    }
    catch(Throwable t) {
      LOG.exceptionWhileStopping("Process Application", processApplicationReference.getName(), t);
    }

  }
1162588
private void shutdown(String applicationName) {
        synchronized (configCache) {
            Set<ClassLoader> appClassLoaders = appClassLoaderMap.remove(applicationName);
            if (appClassLoaders != null) {
                for (ClassLoader classLoader : appClassLoaders) {
                    shutdown(applicationName, classLoader);
                }
            }
        }
    }
1331363
protected void deactivate(ComponentContext context) {
        appListener.unregister(this);

        // shut down instances that were created
        if (!clients.isEmpty())
            AccessController.doPrivileged(new PrivilegedAction<Void>() {
                @Override
                public Void run() {
                    Method shutdown = null;
                    for (Object client : clients.values())
                        try {
                            if (shutdown == null)
                                shutdown = client.getClass().getMethod("shutdown");
                            shutdown.invoke(client);
                        } catch (Throwable x) {
                            // FFDC will be logged, otherwise ignore
                        }
                    return null;
                }
            });

        containerAuthDataRef.deactivate(context);
        sslConfig.deactivate(context);
    }
263408
public synchronized void shutdown() {
        checkIsRunning();
        try {
            beanManager().fireEvent(new ContainerBeforeShutdown(id), BeforeDestroyed.Literal.APPLICATION);
        } finally {
            discard(id);
            // Destroy all the dependent beans correctly
            creationalContext.release();
            beanManager().fireEvent(new ContainerShutdown(id), Destroyed.Literal.APPLICATION);
            bootstrap.shutdown();
            WeldSELogger.LOG.weldContainerShutdown(id);
        }
    }
1373389
@Override
    public void shutdown() {
        try {
            verifyMaintainability();
        } catch (VerificationFailedException ex) {
            throw new RuntimeException("Can not shutdown " + this + "!", ex);
        }

        this.shutdownInitiated = true;
        try {
            dataObservable.shutdown();
        } finally {
            try {
                deactivate();
            } catch (CouldNotPerformException | InterruptedException ex) {
                ExceptionPrinter.printHistory("Could not shutdown " + this + "!", ex, logger);
            }
        }
    }
1199751
@Override
    public void shutDown() {

        super.shutDown();
        indexSearcherClose();
        if (m_analyzer != null) {
            m_analyzer.close();
        }
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SHUTDOWN_INDEX_1, getName()));
        }
    }
278705
public void setShutdown(java.util.Collection<String> shutdown) {
        if (shutdown == null) {
            this.shutdown = null;
            return;
        }

        this.shutdown = new com.amazonaws.internal.SdkInternalList<String>(shutdown);
    }
646058
public void shutdown()
    {
        Environment env = ((BaseApplication)m_app).getEnvironment();
        if (m_app != null)
        	m_app.free();
        m_app = null;
        if (ClassServiceUtility.getClassService().getClassFinder(null) != null)
            ClassServiceUtility.getClassService().getClassFinder(null).shutdownService(null, this);
        if (env != null)
        	env.freeIfDone();
//x        System.exit(0);
    }
1246652
public void shutdown() {
        shutDown = true;
        try {
            while (inflightReceiveMessageBatches > 0)
                Thread.sleep(100);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
    }
1021826
@Override
    public void shutdown() {
        if (this.bootstrap != null) {
            AccessController.doPrivileged(new PrivilegedAction<Void>() {
                @Override
                public Void run() {
                    bootstrap.shutdown();
                    return null;
                }
            });

            this.bootstrap = null;

            this.deploymentDBAs.clear();
            this.applicationBDAs.clear();
            this.classloader = null;
            this.extensionClassLoaders.clear();
            this.cdiEnabled = false;
            this.cdiStatusMap.clear();
            this.application = null;
            this.classBDAMap.clear();
        }
    }
553624
synchronized public void shutdown()
    {
        m_shutdown.set(true);
        if (m_isExecutorServiceLocal) {
            try {
                m_es.shutdown();
                m_es.awaitTermination(365, TimeUnit.DAYS);
            } catch (InterruptedException e) {
                repairLog.warn("Unexpected interrupted exception", e);
            }
        }
    }
1058970
final void shutdown() {
        _enabled = false;
        _ignoredSegs.clear();
        
        if(_executor != null && !_executor.isShutdown()) {
            try {
                _executor.shutdown();
                _log.info("shutdown");
            } catch (Exception e) {
                _log.warn("shutdown abort", e);
            }
            
            try {
                _executor.awaitTermination(_shutdownTimeout, TimeUnit.SECONDS);
            } catch (Exception e) {
                _log.warn("shutdown abort", e);
            }
            
            if(_segTarget != null) {
                try {
                    _updateManager.endUpdate(_segTarget);
                } catch (Exception e) {
                    _log.warn("shutdown abort", e);
                }
            }
        }
        
        _executor = null;
        _state = State.DONE;
    }
184202
@Override
    public void applicationStopping(String appName)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            Tr.entry(tc, "MEF.applicationStopping for application " + appName);
        }

        synchronized (ivStateLock)
        {
            if (ivState == ACTIVE_STATE)
            {
                // No thread is ever waiting for a notification while
                // in the active state, so simply change state to
                // indicate deactivate is pending.
                ivState = DEACTIVATE_PENDING_STATE;
            }
            else if (ivState == ACTIVATING_STATE)
            {
                // Change state to indicate deactivate is pending
                // and notify any thread that is waiting for the activate
                // to complete.
                ivState = DEACTIVATE_PENDING_STATE;
                ivStateLock.notifyAll();
            }
            else if (ivState == DEACTIVATE_PENDING_STATE)
            {
                // activateendpoint threw an exception and changed
                // state to deactivate pending.  So we need to notify
                // threads that are waiting for the activate
                // to complete (e.g. threads blocked by createEndpoint
                // during the activation of an endpoint).
                ivStateLock.notifyAll();
            }
            else if (ivState == INACTIVE_STATE)
            {
                // This is possible, but not likely. For example, we could create this
                // MEF object and initialized it to INACTIVE_STATE.  An exception occurs
                // before we make it to the activateEndpoint method for this MEF.  If
                // that happens, then it is possible to get to this method while in
                // the inactive state.  So simply trace fact that this MEF was called
                // in inactive state and nothing was actually done.
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                {
                    Tr.event(tc, "MEF.applicationStopping for application " + appName
                                 + " was called for an inactive endpoint.");
                }
            }
            else
            {
                // The only other state is DEACTIVATING_STATE. This method should NEVER
                // be called while in the deactivating state. Runtime framework should call
                // this method before it ever attempts to stop the modules of an application.
                // Thus, we should not enter deactivating state until after this method is called.
                // Create FFDC log file for this problem and trace occurrence of this event.
                // No reason to throw the exception since we created it just for the purpose
                // of doing the FFDC.
                String msg = "Internal programming error - applicationStopping called for application \""
                             + appName + "\" while in deactivating state. This should NEVER occur.";
                IllegalStateException ex = new IllegalStateException(msg);
                FFDCFilter.processException(ex, CLASS_NAME + ".applicationStopping", "1208", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                {
                    Tr.event(tc, msg);
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            Tr.exit(tc, "MEF.applicationStopping for application " + appName);
        }
    }
918041
public void shutdown() {
        // Delete the cookie _session if there is one
        Response response = executeToResponse(Http.DELETE(new URIBase(clientUri).path("_session")
                .build()));
        if (!response.isOk()) {
            log.warning("Error deleting session on client shutdown.");
        }
        // The execute method handles non-2xx response codes by throwing a CouchDbException.

        factory.shutdown();
    }