Example usage for org.apache.commons.httpclient.util IdleConnectionTimeoutThread start

List of usage examples for org.apache.commons.httpclient.util IdleConnectionTimeoutThread start

Introduction

In this page you can find the example usage for org.apache.commons.httpclient.util IdleConnectionTimeoutThread start.

Prototype

public synchronized void start() 

Source Link

Document

Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread.

Usage

From source file:com.boyuanitsm.pay.alipay.util.httpClient.HttpProtocolHandler.java

/**
 * ?//from  ww w  . j  av a2  s .  c o  m
 */
private HttpProtocolHandler() {
    // HTTP
    connectionManager = new MultiThreadedHttpConnectionManager();
    connectionManager.getParams().setDefaultMaxConnectionsPerHost(defaultMaxConnPerHost);
    connectionManager.getParams().setMaxTotalConnections(defaultMaxTotalConn);

    IdleConnectionTimeoutThread ict = new IdleConnectionTimeoutThread();
    ict.addConnectionManager(connectionManager);
    ict.setConnectionTimeout(defaultIdleConnTimeout);

    ict.start();
}