Examples of ClientConnectionManager


Examples of com.hazelcast.client.connection.ClientConnectionManager

            tryStopThreads(client);
            tryShutdown(client);
        }

        private static void closeSockets(HazelcastClient client) {
            final ClientConnectionManager connectionManager = client.getConnectionManager();
            if (connectionManager != null) {
                try {
                    connectionManager.shutdown();
                } catch (Throwable ignored) {
                }
            }
        }
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionManager

        {
          sslSocketFactory.setHostnameVerifier(hostnameVerifier);
        }
        registry.register(new Scheme("https", sslSocketFactory, 443));
       
        ClientConnectionManager connManager;
        if (multiThreadedHttpClient)
            connManager = new ThreadSafeClientConnManager(httpParams, registry);
        else
            connManager = new SingleClientConnManager(httpParams, registry);
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionManager

  }

  public class SingleClient implements HttpClientPool {
    SingleClient() {
      org.apache.http.client.HttpClient client = new DefaultHttpClient();
      ClientConnectionManager mgr = client.getConnectionManager();
      if (!(mgr instanceof ThreadSafeClientConnManager)) {
        HttpParams params = client.getParams();
        client = new DefaultHttpClient(new ThreadSafeClientConnManager(
            params, mgr.getSchemeRegistry()), params);
      }

      // Use Proxy to access if you are in one of the countries that cannot connects to twitter directly.  
      // HttpHost proxy = new HttpHost("your_proxy_url", your_proxy_port);
      // client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionManager

              new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));

      // Create an HttpClient with the ThreadSafeClientConnManager.
      // This connection manager must be used if more than one thread will
      // be using the HttpClient.
      ClientConnectionManager cm = new ThreadSafeClientConnManager(params, schemeRegistry);
      HttpClient httpClient = new DefaultHttpClient(cm, params);

      final ApacheHttpClient4Executor executor = new ApacheHttpClient4Executor(httpClient);
      return executor;
   }
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionManager

        registry.register(
                new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
        registry.register(
                new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));

        ClientConnectionManager connManager = null;    
        HttpParams params = getParams();
       
        ClientConnectionManagerFactory factory = null;

        // Try first getting the factory directly as an object.
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionManager

    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(httpsScheme);
    HttpParams params = getHttpParams(connectionTimeout, soTimeout);
    ClientConnectionManager cm = new ThreadSafeClientConnManager(schemeRegistry);
    return new DefaultHttpClient(cm, params);
  }
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionManager

    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(httpsScheme);
    HttpParams params = getHttpParams(connectionTimeout, soTimeout);
    ClientConnectionManager cm = new ThreadSafeClientConnManager(schemeRegistry);
    return new DefaultHttpClient(cm, params);
  }
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionManager

    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(httpsScheme);
    HttpParams params = getHttpParams(connectionTimeout, soTimeout);
    ClientConnectionManager cm = new ThreadSafeClientConnManager(schemeRegistry);
    return new DefaultHttpClient(cm, params);
  }
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionManager

    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(httpsScheme);
    HttpParams params = getHttpParams(connectionTimeout, soTimeout);
    ClientConnectionManager cm = new ThreadSafeClientConnManager(schemeRegistry);
    return new DefaultHttpClient(cm, params);
  }
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionManager

            cachedBoxClient.getListener().onRefresh(boxClient.getAuthData());
        }
    }

    public static void closeIdleConnections(CachedBoxClient cachedBoxClient) {
        @SuppressWarnings("deprecation")
        final ClientConnectionManager connectionManager = cachedBoxClient.getClientConnectionManager();
        if (connectionManager != null) {
            // close all idle connections
            connectionManager.closeIdleConnections(1, TimeUnit.MILLISECONDS);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.