Code example for ThreadSafeClientConnManager

Methods: setDefaultMaxPerRoute, setMaxTotal

        final SchemeRegistry registry = buildSchemeRegistry();
        if (!connectionPooling) {
            return new SingleClientConnManager(registry);
        } else { 
            final ThreadSafeClientConnManager manager = new ThreadSafeClientConnManager(registry);
            return manager;
     * Creates the default scheme registry for connection. The constructed registry supports http with a default port of 
     * 80 and https with a default port of 443. If {@link #connectionDisregardSslCertificate} is true, than the https 
     * port will accept any certificate presented by the responder. 
     * @return the default scheme registry. 
    private SchemeRegistry buildSchemeRegistry() {
        final SchemeRegistry registry = new SchemeRegistry();