/*
(non-Javadoc)

@see com.ibm.ws.container.service.app.deploy.extended.ModuleRuntimeContainer#stopModule(com.ibm.ws.container.service.app.deploy.extended.ExtendedModuleInfo)
489529
@Override
    public void stopModule(ExtendedModuleInfo moduleInfo) {
        SpringBootModuleInfo springBootModuleInfo = (SpringBootModuleInfo) moduleInfo;
        springBootModuleInfo.getSpringBootApplication().unregisterSpringConfigFactory();
        springBootModuleInfo.getSpringBootApplication().callShutdownHooks();
        springBootModuleInfo.destroyThreadContextClassLoader();
    }
1036678
public synchronized void removeScriptModule(ModuleId scriptModuleId) {
        jbossModuleLoader.unloadAllModuleRevision(scriptModuleId.toString());
        ScriptModule oldScriptModule = loadedScriptModules.remove(scriptModuleId);
        if (oldScriptModule != null) {
            notifyModuleUpdate(null, oldScriptModule);
        }
    }
1278857
@Override
    public void stop(int mode) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "stop, mode ", mode);

        // Now force state to STOPPING - regardless of how we got here
        setState(STATE_STOPPING);

        // Reset MP Admin
        _localizer.clearMPAdmin();
        _mpAdmin = null;
        _messageProcessor.stop(mode);
        _messageStore.stop(mode);

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            SibTr.debug(tc, "Messaging Engine " + _name + " finished stop phases");

        setState(STATE_STOPPED);
        SibTr.debug(tc, "Messaging Engine stopped");
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            SibTr.debug(tc, "Messaging Engine " + _name + " has been stopped before dynamic config cycle completed.");

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.debug(tc, "stop");
    }
514004
func shutdownModules() {
	for i := len(modulesArr) - 1; i >= 0; i-- {
		modulesArr[i].module.BeforeShutdown()
	}

	for i := len(modulesArr) - 1; i >= 0; i-- {
		name := modulesArr[i].name
		mod := modulesArr[i].module

		logger.Log.Debugf("stopping module: %s", name)
		if err := mod.Shutdown(); err != nil {
			logger.Log.Warnf("error stopping module: %s", name)
		}
		logger.Log.Infof("module: %s stopped!", name)
	}
}
335807
private void stopApplication(File currentFile) {
        if (_tc.isEventEnabled()) {
            Tr.event(_tc, "Stopping dropin application '" + currentFile.getName() + "'");
        }
        String filePath = getAppLocation(currentFile);

        try {
            Configuration config = _configs.remove(filePath);
            if (config != null) {
                config.delete();
            }
        } catch (Exception e) {
            getAppMessageHelper(null, filePath).error("MONITOR_APP_STOP_FAIL", currentFile.getName());
        }
    }
1263385
@Override
  public void stop(ShutdownModeAmp mode)
    throws Exception
  {
    super.stop(mode);
    
    Alarm alarm = _alarm;
    _alarm = null;

    if (alarm != null) {
      alarm.dequeue();
    }

    for (PortTcp port : _ports) {
      try {
        port.close();
      } catch (Throwable e) {
        log.log(Level.WARNING, e.toString(), e);
      }
    }
    
    _clusterService.stop();
  }
1234923
public void removeModules(List<String> modules) throws Exception {
        long startTime = System.currentTimeMillis();
        Exception exception = null;
        if (!cfg.exists()) {
            init();
        }
        userDir = new File(System.getProperty("user.dir")).getAbsolutePath();
        System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath());
        try {
            ConfigurationManager manager = new ConfigurationManager(cfg, false);

            ProjectConfigurationProvider cfgProvider = manager.getProjectConfigurationProvider();
            cfgProvider.removeModules(modules);
        } catch (Exception e) {
            exception = e;
        } finally {
            System.setProperty("user.dir", userDir);
            updateMsg(startTime, exception);
        }
    }
332291
public void promoteModule(final String moduleId) {
        final DbModule module = getModule(moduleId);

        for (final String gavc : DataUtils.getAllArtifacts(module)) {
            final DbArtifact artifact = repositoryHandler.getArtifact(gavc);
            artifact.setPromoted(true);
            repositoryHandler.store(artifact);
        }

        repositoryHandler.promoteModule(module);
    }
216431
public void stop(BundleContext context) throws Exception {
        ClassServiceUtility.log(context, LogService.LOG_INFO, "Stopping ObrClassFinderImpl");

        super.stop(context);
        repositoryAdmin = null;
        waitingForRepositoryAdmin = false;
        waitingForClassService = false;
        ClassFinderActivator.setClassFinder(null);
    }
79757
def stop_all(self):
        
        logger.info('Shutting down modules...')
        # Ask internal to quit if they can
        for instance in self.get_internal_instances():
            if hasattr(instance, 'quit') and isinstance(instance.quit, collections.Callable):
                instance.quit()

        self.clear_instances([instance for instance in self.instances if instance.is_external])
637961
void closeAllScopeModules() {
        synchronized (puScopes) {
            for (String module : puScopes.keySet()) {
                close(module, false); //PK59717
            }
            puScopes.clear();
        }
    }
399913
public void touchModule(String moduleName) {

        CmsModule module = OpenCms.getModuleManager().getModule(moduleName);
        if (module == null) {
            m_shell.getOut().println("touchModule: could not find module " + moduleName);
        } else {
            m_shell.getOut().println("Touching module: " + moduleName);
            module.setCheckpointTime(System.currentTimeMillis());
            m_shell.getOut().println("Writing module configuration.");
            OpenCms.getModuleManager().updateModuleConfiguration();
        }
    }
554957
public void addSoftwareModule(final DmfSoftwareModule createSoftwareModule) {
        if (softwareModules == null) {
            softwareModules = new ArrayList<>();
        }

        softwareModules.add(createSoftwareModule);

    }
772878
public synchronized boolean deleteModule(String fileName) throws CmsException {

        String moduleName = null;
        boolean ok = true;
        try {
            CmsModule module = getModuleForFileName(fileName);
            if (module == null) {
                LOG.error("Deletion request for invalid module file name: " + fileName);
                ok = false;
                return false;
            }
            I_CmsReport report = createReport();
            moduleName = module.getName();
            OpenCms.getModuleManager().deleteModule(m_adminCms, module.getName(), false, report);
            ok = !(report.hasWarning() || report.hasError());
            return true;
        } catch (Exception e) {
            ok = false;
            if (e instanceof CmsException) {
                throw (CmsException)e;
            }
            if (e instanceof RuntimeException) {
                throw (RuntimeException)e;
            }
            return true;
        } finally {
            m_moduleLog.log(moduleName, Action.deleteModule, ok);
        }

    }
90016
public void stopMessagingEngine(String busName, String name, String mode)
                    throws Exception {

        String thisMethodName = CLASS_NAME
                                + ".stopMessagingEngine(String, String, String)";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName,
                        new Object[] { busName, name, mode });
        }

        int iMode = Integer.parseInt(mode);
        stopMessagingEngine(busName, name, iMode);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName);
        }
    }
12668
private void deployModule(final Node node, final InstanceContext instance, final CountingCompletionHandler<Void> counter) {
    log.debug(String.format("%s - Deploying %s to %s", NetworkManager.this, instance.component().asModule().module(), node.address()));
    node.deployModule(instance.component().asModule().module(), Components.buildConfig(instance, cluster), 1, new Handler<AsyncResult<String>>() {
      @Override
      public void handle(AsyncResult<String> result) {
        if (result.failed()) {
          counter.fail(result.cause());
        } else {
          deploymentIDs.put(instance.address(), result.result(), new Handler<AsyncResult<String>>() {
            @Override
            public void handle(AsyncResult<String> result) {
              counter.succeed();
            }
          });
        }
      }
    });
  }
865706
public void stoppingModule(EJBModuleMetaDataImpl mmd) { // F743-26072
        boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "stoppingModule: " + mmd.getJ2EEName());

        // If the application is stopping (rather than a single module), then
        // we don't need to do anything special.
        if (!ivStopping) {
            mmd.ivStopping = true;
            ivModules.remove(mmd);

            try {
                beginStopping(false, mmd.getJ2EEName(), Collections.singletonList(mmd));
            } finally {
                // If fine-grained module start failed, be sure to clear
                // internal state.
                ivSingletonDependencies = null;
                ivStartupSingletonList = null;
                ivQueuedNonPersistentTimers = null;
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "stoppingModule");
    }