Example usage for org.apache.http.conn ClientConnectionManager shutdown

List of usage examples for org.apache.http.conn ClientConnectionManager shutdown

Introduction

In this page you can find the example usage for org.apache.http.conn ClientConnectionManager shutdown.

Prototype

void shutdown();

Source Link

Document

Shuts down this connection manager and releases allocated resources.

Usage

From source file:com.intel.cosbench.client.http.HttpClientUtil.java

/**
 * Releases the resources held by the given HTTP client.<br />
 * Note that no further connections can be made upon a disposed HTTP client.
 * /*  w  w  w  . j a v  a 2s .  c  o m*/
 * @param client
 *            the HTTP client to be disposed.
 */
public static void disposeHttpClient(HttpClient client) {
    ClientConnectionManager manager = client.getConnectionManager();
    manager.shutdown();
}

From source file:com.tortel.authenticator.common.utils.DependencyInjector.java

/**
 * Closes any resources and objects held by this injector.
 *//*from w  w w.j av  a  2s  .  c  o m*/
public static synchronized void close() {
    if (sAccountDb != null) {
        sAccountDb.close();
    }
    if (sHttpClient != null) {
        ClientConnectionManager httpClientConnectionManager = sHttpClient.getConnectionManager();
        if (httpClientConnectionManager != null) {
            httpClientConnectionManager.shutdown();
        }
    }

    sMode = null;
    sContext = null;
    sAccountDb = null;
    sOtpProvider = null;
    sTotpClock = null;
    sPackageManager = null;
    sHttpClient = null;
}

From source file:com.google.android.apps.authenticator.testability.DependencyInjector.java

/**
 * Closes any resources and objects held by this injector. To use the injector again, invoke
 * {@link #resetForIntegrationTesting(Context)}.
 *//*w  ww  .ja  va 2s .  c  o  m*/
public static synchronized void close() {
    if (sAccountDb != null) {
        sAccountDb.close();
    }
    if (sHttpClient != null) {
        ClientConnectionManager httpClientConnectionManager = sHttpClient.getConnectionManager();
        if (httpClientConnectionManager != null) {
            httpClientConnectionManager.shutdown();
        }
    }

    sMode = null;
    sContext = null;
    sAccountDb = null;
    sOtpProvider = null;
    sTotpClock = null;
    sPackageManager = null;
    sStartActivityListener = null;
    sHttpClient = null;
    sImportController = null;
    sOptionalFeatures = null;
}

From source file:org.apache.camel.component.box.internal.BoxClientHelper.java

public static void shutdownBoxClient(BoxConfiguration configuration, CachedBoxClient cachedBoxClient)
        throws BoxServerException, BoxRestException, AuthFatalFailureException {

    final BoxClient boxClient = cachedBoxClient.getBoxClient();
    synchronized (boxClient) {

        LOG.debug("Shutting down {} ...", cachedBoxClient);
        try {//from  ww w.  j a  v a 2s.  c om
            // revoke token if requested
            if (configuration.isRevokeOnShutdown()) {
                revokeOAuthToken(configuration, cachedBoxClient);
            }
        } finally {

            boxClient.setConnectionOpen(false);
            // close connections in the underlying HttpClient
            @SuppressWarnings("deprecation")
            final ClientConnectionManager connectionManager = cachedBoxClient.getClientConnectionManager();
            if (connectionManager != null) {
                LOG.debug("Closing connections for {}", cachedBoxClient);

                connectionManager.shutdown();
            } else {
                LOG.debug("ConnectionManager not created for {}", cachedBoxClient);
            }
        }
        LOG.debug("Shutdown successful for {}", cachedBoxClient);
    }
}

From source file:com.google.android.apps.authenticator.testability.HttpClientFactoryTest.java

@Override
protected void tearDown() throws Exception {
    if (mClient != null) {
        ClientConnectionManager connectionManager = mClient.getConnectionManager();
        if (connectionManager != null) {
            connectionManager.shutdown();
        }//from w  w  w.ja va  2  s .com
    }
    super.tearDown();
}

From source file:org.robertburrelldonkin.template4couchdb.rest.HttpClientRestClient.java

public void shutdown() {
    final ClientConnectionManager connectionManager = this.httpClient.getConnectionManager();
    if (connectionManager != null) {
        connectionManager.shutdown();
    }/*  w ww. ja  v  a2 s.com*/
}

From source file:com.dubsar_dictionary.SecureClient.SecureAndroidHttpClient.java

public void close() {
    ClientConnectionManager manager = getConnectionManager();
    if (manager != null) {
        manager.shutdown();
    }
}

From source file:org.apache.oltu.oauth2.httpclient4.HttpClient4.java

public void shutdown() {
    if (client != null) {
        ClientConnectionManager connectionManager = client.getConnectionManager();
        if (connectionManager != null) {
            connectionManager.shutdown();
        }/*from  w  w w.  j a  v a  2  s.c o m*/
    }
}

From source file:org.eclipse.aether.transport.http.GlobalState.java

public void close() {
    for (Iterator<Map.Entry<SslConfig, ClientConnectionManager>> it = connectionManagers.entrySet()
            .iterator(); it.hasNext();) {
        ClientConnectionManager connMgr = it.next().getValue();
        it.remove();/*  ww  w . j a va2  s.com*/
        connMgr.shutdown();
    }
}

From source file:org.yamj.core.tools.web.PoolingHttpClient.java

@Override
public void destroy() throws Exception {
    ClientConnectionManager clientManager = super.getConnectionManager();
    if (clientManager != null) {
        clientManager.shutdown();
    }/*  www  .  j  a  v a 2 s.c o  m*/
}