Closes the service pool associated with the specified dynamic service proxy.
@param dynamicProxy A service pool dynamic proxy created by {@link ServicePoolBuilder#buildProxy}.
@param <S> The service interface type.
779198
public static <S> void close(S dynamicProxy) {
        // Use closeQuietly since ServicePool.close() doesn't throw IOException.
        try {
            Closeables.close(getPool(dynamicProxy), true);
        } catch (IOException e) {
            throw new AssertionError();  // close swallows IOExceptions
        }
    }
455430
public void close() {
        for (KSIExtendingService service : subservices) {
            try {
                service.close();
            } catch (IOException e) {
                logger.error("Failed to close subservice", e);
            }
        }
    }
302432
@Override
    public void closeConnection(Object connection) {
        if (connection!=null) {
            ((SoccomClient)connection).close();
            connection = null;
        }
    }
149944
public void removeProxyServer(ProxyServer proxyServer) {
        proxyServers.remove(proxyServer);
        extensionHooks.values().forEach(extHook -> unhookProxyServer(extHook, proxyServer));
    }
723302
public static void recursiveDelete(final ServiceBundler services, final Session session, final IRI identifier,
            final String baseUrl) {
        final List<IRI> resources = services.getResourceService().get(identifier)
            .thenApply(res -> res.stream(LDP.PreferContainment).map(Quad::getObject).filter(IRI.class::isInstance)
                    .map(IRI.class::cast).collect(toList())).toCompletableFuture().join();
        resources.forEach(id -> recursiveDelete(services, session, id, baseUrl));
        resources.stream().parallel().map(id -> {
                final TrellisDataset immutable = TrellisDataset.createDataset();
                services.getAuditService().creation(id, session).stream()
                    .map(skolemizeQuads(services.getResourceService(), baseUrl)).forEachOrdered(immutable::add);

                return services.getResourceService().delete(Metadata.builder(id).interactionModel(LDP.Resource)
                        .container(identifier).build())
                    .thenCompose(future -> services.getResourceService().add(id, immutable.asDataset()))
                    .whenComplete((a, b) -> immutable.close())
                    .thenAccept(future -> services.getEventService().emit(new SimpleEvent(externalUrl(id, baseUrl),
                                session.getAgent(), asList(PROV.Activity, AS.Delete), singletonList(LDP.Resource))));
            })
            .map(CompletionStage::toCompletableFuture).forEach(CompletableFuture::join);
    }
1128771
public void destroyDestination(Destination d)
	{
		// method invocation is idempotent
		synchronized (proxies) {
			final AggregatorProxy p = (AggregatorProxy) proxies.get(d.getAddress());
			if (p == null)
				return;
			if (p.getDestination() == d) {
				proxies.remove(d.getAddress());
				d.destroy();
			}
			else
				logger.warn("not owner of " + d.getAddress());
		}
	}
753121
@Override
  public void closeOperation(OperationHandle opHandle)
      throws HiveSQLException {
    sessionManager.getOperationManager().getOperation(opHandle)
    .getParentSession().closeOperation(opHandle);
    LOG.debug(opHandle + ": closeOperation");
  }
1315099
protected void setProxyID(short s)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setProxyID", ""+s);
      proxyID = s;
      proxyIDSet = true;
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setProxyID");
   }
815487
@Override @DefinedBy(Api.COMPILER)
    public void close() throws IOException {
        if (deferredCloseTimeout > 0) {
            deferredClose();
            return;
        }

        locations.close();
        for (Container container: containers.values()) {
            container.close();
        }
        containers.clear();
        contentCache.clear();
    }
151685
public void close() {
        synchronized(factory.cnxns){
            // if this is not in cnxns then it's already closed
            if (!factory.cnxns.remove(this)) {
                return;
            }

            synchronized (factory.ipMap) {
                Set<NIOServerCnxn> s =
                    factory.ipMap.get(sock.socket().getInetAddress());
                s.remove(this);
            }

            // unregister from JMX
            try {
                if(jmxConnectionBean != null){
                    MBeanRegistry.getInstance().unregister(jmxConnectionBean);
                }
            } catch (Exception e) {
                LOG.warn("Failed to unregister with JMX", e);
            }
            jmxConnectionBean = null;

            if (zk != null) {
                zk.removeCnxn(this);
            }

            closeSock();

            if (sk != null) {
                try {
                    // need to cancel this selection key from the selector
                    sk.cancel();
                } catch (Exception e) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("ignoring exception during selectionkey cancel", e);
                    }
                }
            }
        }
    }
116570
public void setHttpProxy(String httpProxy) {
		this.httpProxy = httpProxy;
		
		if (httpProxy == null) {
//			throw new IllegalArgumentException("'httpProxy' cannot be null");
			return;
		}
		
		String[] tokens = httpProxy.split(":");
		int count = tokens.length; 
		if (count == 1) {
			System.setProperty("http.proxyHost", tokens[0]);
		} else if (count == 2) {
			System.setProperty("http.proxyHost", tokens[0]);
			System.setProperty("http.proxyPort", tokens[1]);
		}		
	}
1233781
public synchronized void close() throws IOException {
        if(getStatus().equals(ConnectionStatus.CLOSED)){
            return ;
        }
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Closing client for session: 0x"
                      + getSessionId());
        }
        connectRun.set(false);

        try{
            clientSocket.cleanup();
        }catch(Exception e){
            LOGGER.warn("Close the WSDirectorySocket get error.", e);
        }

        try {
            setStatus(ConnectionStatus.CLOSED);
            sendCloseSession();
            closeSession();
            eventThread.queueEventOfDeath();
        } catch (ServiceException e) {
            LOGGER.warn("Execute the CloseSession Protocol failed when close", e);
        }
    }
162530
public void close() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "close, vc=" + getVCHash());
        }

        synchronized (closeSync) {
            if (closeCalled) {
                return;
            }

            closeCalled = true;
            if (null != this.netBuffer) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Releasing netBuffer during close "
                                 + SSLUtils.getBufferTraceInfo(netBuffer));
                }
                this.netBuffer.release();
                this.netBuffer = null;
            }

            cleanupDecBuffers();
            if (unconsumedDecData != null) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Releasing unconsumed decrypted buffers, "
                                 + SSLUtils.getBufferTraceInfo(unconsumedDecData));
                }
                WsByteBufferUtils.releaseBufferArray(unconsumedDecData);
                unconsumedDecData = null;
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "close");
        }
    }
577606
public void close() {
        long endNanos = System.nanoTime();
        long durationNanos = endNanos - startNanos;
        connectionPoolCallback.releaseConnection(durationNanos);
    }
470183
@Override
    public void closeConnection() throws JdbcServerException {
        if (!endpointConfiguration.isAutoConnect()) {
            handleMessageAndCheckResponse(JdbcMessage.closeConnection());
        }

        if (connections.decrementAndGet() < 0) {
            connections.set(0);
        }
    }
82110
public void close() {
        try {
            // Request BMP to create a new HAR for this Proxy
            HttpDelete shutdownProxyDELETE = new HttpDelete(requestURIBuilder()
                    .setPath(proxyURIPath())
                    .build());

            // Execute request
            CloseableHttpResponse response = HTTPclient.execute(shutdownProxyDELETE);

            // Check request was successful
            int statusCode = response.getStatusLine().getStatusCode();
            if (statusCode != 200) {
                throw new BMPCUnableToCloseProxyException(String.format(
                        "Invalid HTTP Response when attempting to close " +
                                "Proxy '%d'. Status code: %d",
                        proxyPort, statusCode));
            }
            // Close HTTP Response
            response.close();

            // Close HTTP Client
            HTTPclient.close();
        } catch (Exception e) {
            throw new BMPCUnableToCloseProxyException(e);
        }
    }
419683
@Override
    public void close() {
        if (!this.closed.getAndSet(true)) {
            if (state() == State.RUNNING) {
                Futures.await(Services.stopAsync(this, this.executorService));
            }

            synchronized (this.clients) {
                this.clients.clear();
            }

            this.metrics.close();
            log.info("{} Closed.", TRACE_OBJECT_ID);
        }
    }