Releases all resources used by the Manager instance and closes all its databases.
763033
@InterfaceAudience.Public
    public void close() {
        synchronized (lockDatabases) {
            Log.d(Database.TAG, "Closing " + this);

            // Close all database:
            // Snapshot of the current open database to avoid concurrent modification as
            // the database will be forgotten (removed from the databases map) when it is closed:
            Database[] openDbs = databases.values().toArray(new Database[databases.size()]);
            for (Database database : openDbs)
                database.close();
            databases.clear();

            // Stop reachability:
            context.getNetworkReachabilityManager().stopListening();

            // Shutdown ScheduledExecutorService:
            if (workExecutor != null && !workExecutor.isShutdown())
                Utils.shutdownAndAwaitTermination(workExecutor);

            Log.d(Database.TAG, "Closed " + this);
        }
    }
2245
@Override
    public void destroyResources() {
        if (eurekaConnCleaner != null) {
            // Execute the connection cleaner one final time during shutdown
            eurekaConnCleaner.execute(connectionCleanerTask);
            eurekaConnCleaner.shutdown();
        }
        if (apacheHttpClient != null) {
            apacheHttpClient.close();
        }
    }
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
1134877
public function close(): void
    {
        if ($this->isClosed) {
            return;
        }

        $this->isEnding = true;
        $this->isClosed = true;

        $this->connection->close();
        $this->emit('close');

        $this->pool->rejectAll(new ConnectionClosedException());
    }
903881
public void terminateAllConnections(){
		this.terminationLock.lock();
		try{
			// close off all connections.
			for (int i=0; i < this.pool.partitionCount; i++) {
				this.pool.partitions[i].setUnableToCreateMoreTransactions(false); // we can create new ones now, this is an optimization
				List<ConnectionHandle> clist = new LinkedList<ConnectionHandle>(); 
				this.pool.partitions[i].getFreeConnections().drainTo(clist);
				for (ConnectionHandle c: clist){
					this.pool.destroyConnection(c);
				}

			}
		} finally {
			this.terminationLock.unlock();
		}
	}
543137
def cleanup(self):
        
        # Closes connections to all databases to avoid the long running process
        # from holding connections indefinitely.
        for alias in db.connections.databases:
            logger.info('Closing database connection: %s', alias)
            db.connections[alias].close()
515325
def close(self):
        
        for pool in self.__pool.values():
            while not pool.empty():
                conn = pool.get_nowait()
                try:
                    self._close(conn)
                except Exception:
                    pass

        # reset the pool size after closing all connections
        self.__poolSize.clear()
77735
@Override
  public void close() throws IOException {
    try {
      mLock.lock();
      if (mAvailableResources.size() != mResources.size()) {
        LOG.warn("{} resources are not released when closing the resource pool.",
            mResources.size() - mAvailableResources.size());
      }
      for (ResourceInternal<T> resourceInternal : mAvailableResources) {
        closeResource(resourceInternal.mResource);
      }
      mAvailableResources.clear();
    } finally {
      mLock.unlock();
    }
    mGcFuture.cancel(true);
  }
1148171
def release(self):
        
        if self.errored:
            self.pool.delete_resource(self)
        else:
            self.pool.release(self)
782700
@Override
  public void close() {
    if (isClosed())
      return;

    checkOpeness();
    rollback();

    final OMetadata md = getMetadata();
    if (md != null)
      md.close();

    ((ODatabaseRaw) ((ODatabaseRecord) underlying).getUnderlying()).callOnCloseListeners();
    getLevel1Cache().clear();

    ownerPool.release(this);
    ownerPool = null;
  }
684586
protected synchronized void releaseAllConnectionPools() {

    for (HikariDataSource pool : pools.values()) {

      if (pool != null) {
        logger.info("Releasing pool: {}...", pool.getPoolName());
        pool.close();
      }
    }
  }
186193
@Override
    public void close() throws Exception {
        try {
            this.servers.stream().filter(Objects::nonNull).forEach(BookieServer::shutdown);
            if (this.zkServer.get() != null) {
                this.zkServer.get().close();
            }
        } finally {
            cleanupDirectories();
        }

        Thread c = this.cleanup.getAndSet(null);
        if (c != null) {
            Runtime.getRuntime().removeShutdownHook(c);
        }
    }
1186188
public void close() {
		for (Entry<String, OResourcePool<String, CH>> pool : pools.entrySet()) {
			for (CH channel : pool.getValue().getResources()) {
				channel.close();
			}
		}
	}
461461
public void releaseResources() {
		for (InputStream str : fis) {
			try {
				str.close();
			} catch (Exception e) {
				LOG.info("Exception while trying to close streams", e);
			}
		}
	}
583040
@Override
    public void cleanup() throws ResourceException {
        this.session.logout();
        this.session = openSession();
        this.transactions = session.getRepository().transactions();
        this.handles.clear();
    }
88321
@Override
    public void shutdown() {
        Throwable shutdownException = null;
        try {
            fire(new ManagerStopping());
        } catch (Exception e) {
            try {
                fireException(e);
            } catch (Exception e2) {
                shutdownException = e2;
            }
        }
        synchronized (this) {
            for (Context context : contexts) {
                context.clearAll();
            }
            contexts.clear();
            extensions.clear();

            runtimeLogger.clear();

            handledThrowables.remove();
        }
        if (shutdownException != null) {
            UncheckedThrow.throwUnchecked(shutdownException);
        }
    }
721592
def shutdown(self):
        

        # Remove ourself from the dictionary of running managers
        try:
            del self._running_managers[self._manager_key]
        except KeyError:
            pass

        # Kill the listening thread
        self._listen_thread.kill()

        # Close all the connections
        for conn in self.tendrils.values():
            conn.close()

        # Ensure all data is appropriately reset
        self.tendrils = {}
        self.running = False
        self._local_addr = None
        self._local_addr_event.clear()
        self._listen_thread = None