Convenience method. Closes all leases in the given collection of leases

@param leases leases to close
549696
public void     returnAll(Collection<Lease> leases)
    {
        for ( Lease l : leases )
        {
            CloseableUtils.closeQuietly(l);
        }
    }
262567
@Override
    public List<ENTRY> removeAll(Collection<ENTRY> entries) throws MultiException, InvalidStateException {
        final List<ENTRY> removedEntries = new ArrayList<>();
        ExceptionStack exceptionStack = null;
        registryLock.writeLock().lock();
        try {
            for (ENTRY entry : entries) {

                // shutdown check is needed because this is not a atomic transaction.
                if (shutdownInitiated) {
                    throw new InvalidStateException("Entry removal canceled because registry is shutting down!");
                }

                try {
                    if (contains(entry)) {
                        removedEntries.add(remove(entry));
                    }
                } catch (CouldNotPerformException ex) {
                    exceptionStack = MultiException.push(this, ex, exceptionStack);
                }
            }
            MultiException.checkAndThrow(() -> "Could not remove all entries!", exceptionStack);
        } finally {
            registryLock.writeLock().unlock();
        }
        return removedEntries;
    }
243020
private void closeAllSession(ManageableRepository mr) throws NoSuchWorkspaceException
   {
      for (String wsName : mr.getWorkspaceNames())
      {
         if (!mr.canRemoveWorkspace(wsName))
         {
            WorkspaceContainerFacade wc = mr.getWorkspaceContainer(wsName);
            SessionRegistry sessionRegistry = (SessionRegistry)wc.getComponent(SessionRegistry.class);
            sessionRegistry.closeSessions(wsName);
         }
      }
   }
908376
synchronized void replaceLease(Lease newLease) {
    leases.put(newLease.getHolder(), newLease);
    sortedLeases.remove(newLease);
    sortedLeases.add(newLease);

    for (String path : newLease.paths) {
      sortedLeasesByPath.put(
        path, new LeaseOpenTime(newLease, System.currentTimeMillis()));
    }
  }
1354297
@Override
  public void close()
  {
    super.close();
    facts.clear();
    indexAndOffsets.clear();

    if (selectors != null) {
      selectors.clear();
    }

    Closer c = Closer.create();
    aggBuffers.forEach(c::register);
    try {
      c.close();
    }
    catch (IOException e) {
      throw new RuntimeException(e);
    }
    aggBuffers.clear();
  }
462862
@Override
    public void close() {
        if (!this.closed.getAndSet(true)) {
            this.metricReporter.cancel(true);
            this.metrics.close();
            this.rolloverProcessor.close();
            this.writeProcessor.close();

            // Close active ledger.
            WriteLedger writeLedger;
            synchronized (this.lock) {
                writeLedger = this.writeLedger;
                this.writeLedger = null;
                this.logMetadata = null;
            }

            // Close the write queue and cancel the pending writes.
            this.writes.close().forEach(w -> w.fail(new CancellationException("BookKeeperLog has been closed."), true));

            if (writeLedger != null) {
                try {
                    Ledgers.close(writeLedger.ledger);
                } catch (DurableDataLogException bkEx) {
                    log.error("{}: Unable to close LedgerHandle for Ledger {}.", this.traceObjectId, writeLedger.ledger.getId(), bkEx);
                }
            }

            log.info("{}: Closed.", this.traceObjectId);
        }
    }
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();
		}
	}
83628
public static void close(Connection conn, Statement stmt, ResultSet rs) {
        close(rs);
        close(stmt);
        close(conn);
    }
1156330
@Override
  public void close() {
    LOG.info("Closing " + this.getClass().getSimpleName());
    try (Connection conn = createConnection()) {
      JdbcWriterCommands commands = createJdbcWriterCommands(conn);
      if (!this.createdStagingTables.isEmpty()) {
        for (String stagingTable : this.createdStagingTables) {
          LOG.info("Dropping staging table " + this.createdStagingTables);
          commands.drop(database, stagingTable);
        }
      }

      if (this.userCreatedStagingTable != null) {
        LOG.info("Truncating staging table " + this.userCreatedStagingTable);
        commands.truncate(database, this.userCreatedStagingTable);
      }
    } catch (SQLException e) {
      throw new RuntimeException("Failed to close", e);
    }
  }
1020167
public void close() {
    if (indexManager != null)
      indexManager.flush();
    if (schema != null)
      schema.close();
    if (security != null)
      security.close();
  }
525129
@Override
    public void close() {
        if (this.closed.compareAndSet(false, true)) {
            this.extensions.values().forEach(SegmentContainerExtension::close);
            Futures.await(Services.stopAsync(this, this.executor));
            this.metadataCleaner.close();
            this.writer.close();
            this.durableLog.close();
            this.readIndex.close();
            this.storage.close();
            log.info("{}: Closed.", this.traceObjectId);
        }
    }
779233
public void forceClose() {
        // Move all elements from usedInstances to unusedInstances in a threadsafe way
        for (final T usedInstance : new ArrayList<>(usedInstances)) {
            if (usedInstances.remove(usedInstance)) {
                unusedInstances.add(usedInstance);
            }
        }
        close();
    }
1280914
def close(self):
        
        transports, self.transports = self.transports, []
        for transport in transports:
            transport.close()
1290876
public static void closeAll(Logger log, java.io.Closeable... closeables) {
    for (java.io.Closeable c : closeables) {
      if (c != null) {
        try {
          if (log != null) {
            log.debug("Closing {}", c);
          }
          c.close();
        } catch (Exception e) {
          if (log != null && log.isDebugEnabled()) {
            log.debug("Exception in closing {}", c, e);
          }
        }
      }
    }
  }
951904
@Close
	public void close() {
        DatastoreConnection con = getDatastoreConnections().poll();
		if (con != null) {
			logger.info("Closing dictionary: {}", this);
			con.close();
		}
	}
1332900
@Override
    public void close() {
        if (zipFileSliceReaderRecycler != null) {
            zipFileSliceReaderRecycler.close();
        }
        if (entries != null) {
            entries.clear();
            entries = null;
        }
    }
1186188
public void close() {
		for (Entry<String, OResourcePool<String, CH>> pool : pools.entrySet()) {
			for (CH channel : pool.getValue().getResources()) {
				channel.close();
			}
		}
	}