Code example for ThreadSafeClientConnManager

Methods: setDefaultMaxPerRoute, setMaxTotal

0
	private ThreadSafeClientConnManager connectionManager;
    private final DefaultHttpClient client;
     
    public HttpFetchProtocol() 
    { 
        this.connectionManager = new ThreadSafeClientConnManager();
        this.client = new DefaultHttpClient(this.connectionManager);
        this.client.getParams().setParameter(CoreProtocolPNames.USER_AGENT, "BagIt Library Parallel Fetcher");
 
        // Since we control the threading manually, set the max 
        // configuration values to Very Large Numbers. 
        this.connectionManager.setDefaultMaxPerRoute(Integer.MAX_VALUE);
        this.connectionManager.setMaxTotal(Integer.MAX_VALUE);
 
    	// Set the socket timeout, so that it does not default to infinity. 
    	// Otherwise, broken TCP steams can hang threads forever. 
        client.getParams().setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 20 * 1000);
		client.getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 20 * 1000);
    } 
     
	public void setRelaxedSsl(boolean relaxedSsl)