org.apache.commons.httpclient.util.IdleConnectionTimeoutThread Java Examples

The following examples show how to use org.apache.commons.httpclient.util.IdleConnectionTimeoutThread. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HttpProtocolHandler.java    From Shop-for-JavaWeb with MIT License 5 votes vote down vote up
/**
 * 私有的构造方法
 */
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();
}
 
Example #2
Source File: HttpProtocolHandler.java    From roncoo-pay with Apache License 2.0 5 votes vote down vote up
/**
 * 私有的构造方法
 */
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();
}
 
Example #3
Source File: HttpProtocolHandler.java    From roncoo-pay with Apache License 2.0 5 votes vote down vote up
/**
 * 私有的构造方法
 */
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();
}
 
Example #4
Source File: HttpProtocolHandler.java    From xmu-2016-MrCode with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 私有的构造方法
 */
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();
}
 
Example #5
Source File: HttpProtocolHandler.java    From shopping with Apache License 2.0 5 votes vote down vote up
/**
 * 私有的构造方法
 */
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();
}