Close all regions and shut down the region manager entirely
970447
function(){
      this.removeRegions();
      var args = Array.prototype.slice.call(arguments);
      Marionette.Controller.prototype.close.apply(this, args);
    }
968090
@Override
    public void stopPlatform() {
        try {
            for (Entry<String, AgentController> e : this.createdAgents
                    .entrySet()) {
                AgentController ac = e.getValue();
                ac.kill();
            }
            for (Entry<String, ContainerController> e : this.platformContainers
                    .entrySet()) {
                ContainerController cc = e.getValue();
                cc.kill();
            }
            this.mainContainer.kill();
            this.runtime.shutDown();
        } catch (Exception e) {
            logger.warning("Warning shuting down JADE platform: "
                    + e.getMessage());
        }
    }
549164
def exit(self):
        """"""
        # To ensure all connections are properly closed
        self.client.flush()
        self.client.close()
        # Call the father method
        super(Export, self).exit()
798101
def close(self):
        """"""

        # remove callbacks
        DatastoreLegacy.datastores[self.domain].remove(self)

        # delete data after the last instance is gone
        if self.release_storage and \
           not DatastoreLegacy.datastores[self.domain]:
            del DatastoreLegacy.store[self.domain]

        del self
1273425
public void shutdown ()
    {
        // shut down all active places
        for (Iterator<PlaceManager> iter = enumeratePlaceManagers(); iter.hasNext(); ) {
            PlaceManager pmgr = iter.next();
            try {
                pmgr.shutdown();
            } catch (Exception e) {
                log.warning("Place manager failed shutting down", "where", pmgr.where(), e);
            }
        }
    }
806352
@Invalidate
    public void stop() {
        unregisterConfigurationsExposedAsServices();
        if (registration != null) {
            registration.unregister();
            registration = null;
            try {
                watcher.removeAndStopIfNeeded(configFile.getParentFile());
            } catch (RuntimeException e) { //NOSONAR
                // An exception can be thrown when the platform is shutting down.
                // ignore it.
            }
        }
    }
919830
def terminate(self):
        """"""
        logger.info("deleting entire server %s" % self)
        self.close()
        try:
            shutil.rmtree(self.basedir)
            logger.info("deleted server under %s" % self.basedir)
            # delete everything from self, so that using this object fails results
            # in an error as quickly as possible
            for val in self.__dict__.keys():
                try:
                    delattr(self, val)
                except:
                    pass
        except Exception, e:
            logger.warning("failed to delete SessionServer: %s" % (e))
50208
@LifecycleStop
  public void stop()
  {
    giant.lock();

    try {
      tasks.clear();
      taskFutures.clear();
      active = false;
      managerExec.shutdownNow();
      storageSyncExec.shutdownNow();
      managementMayBeNecessary.signalAll();
    }
    finally {
      giant.unlock();
    }
  }
1282939
def _shutdown(self):
        """"""
        global sconf_global, _ac_config_hs

        if not self.active:
            raise SCons.Errors.UserError("Finish may be called only once!")
        if self.logstream is not None and not dryrun:
            self.logstream.write("\n")
            self.logstream.close()
            self.logstream = None
        # remove the SConfSourceBuilder from the environment
        blds = self.env['BUILDERS']
        del blds['SConfSourceBuilder']
        self.env.Replace( BUILDERS=blds )
        self.active = 0
        sconf_global = None
        if not self.config_h is None:
            _ac_config_hs[self.config_h] = self.config_h_text
        self.env.fs = self.lastEnvFs
182235
def close(self):
        """"""

        # remove callbacks
        Datastore.stores[self.domain].remove(self)

        # delete data after the last instance is gone
        if self.release_storage and not Datastore.stores[self.domain]:
            del Datastore.global_data[self.domain]

        del self
637961
void closeAllScopeModules() {
        synchronized (puScopes) {
            for (String module : puScopes.keySet()) {
                close(module, false); //PK59717
            }
            puScopes.clear();
        }
    }
521446
def close(self):
        """"""
        if globals()['_GLOBAL_DONE'] == 0:
            globals()['_GLOBAL_DONE'] = 1
            self.notify_all()
            self.engine.notify()
            self.unregister_all_services()
            for i in self.intf.values():
                try:
                    # there are cases, when we start mDNS without network
                    i.setsockopt(socket.SOL_IP, socket.IP_DROP_MEMBERSHIP,
                            socket.inet_aton(_MDNS_ADDR) + \
                                    socket.inet_aton('0.0.0.0'))
                except:
                    pass
                i.close()
375593
def exit(self):
        """"""
        # To ensure all connections are properly closed
        self.session.shutdown()
        self.cluster.shutdown()
        # Call the father method
        super(Export, self).exit()
937380
function () {
    if (this.isClosed){ return; }
    this.regionManager.close();
    var args = Array.prototype.slice.apply(arguments);
    Marionette.ItemView.prototype.close.apply(this, args);
  }
661854
def close(self):
        """"""
        logger.debug('closing dongle, {} active connections'.format(len(self.conn_handles)))
        if self.is_scanning():
            logger.debug('in scanning mode, calling end_scan')
            self.end_scan()
        self.reset()
        if self.api is not None:
            self.api.stop_daemon()
            self.api = None
870317
private void closeNetworkResources() {
		for (ResultPartition partition : producedPartitions) {
			try {
				partition.close();
			} catch (Throwable t) {
				ExceptionUtils.rethrowIfFatalError(t);
				LOG.error("Failed to release result partition for task {}.", taskNameWithSubtask, t);
			}
		}

		for (InputGate inputGate : inputGates) {
			try {
				inputGate.close();
			} catch (Throwable t) {
				ExceptionUtils.rethrowIfFatalError(t);
				LOG.error("Failed to release input gate for task {}.", taskNameWithSubtask, t);
			}
		}
	}
677720
def close(self):
        
        gevent.killall(self._tasks, block=True)
        self._tasks = []
        self._ssh.close()