Methods Summary |
---|
private void | checkSystemProperties()
String httpMaxConnections = AccessController.doPrivileged(new PriviAction<String>("http.maxConnections"));
String httpKeepAlive = AccessController.doPrivileged(new PriviAction<String>("http.keepAlive"));
if(httpMaxConnections != null) {
maxConnections = Integer.parseInt(httpMaxConnections);
}
if(httpKeepAlive != null) {
keepAlive = Boolean.parseBoolean(httpKeepAlive);
if(!keepAlive) {
pool.clear();
}
}
|
public HttpConnection | getConnection(java.net.URI uri, int connectTimeout)
checkSystemProperties();
HttpConfiguration config = new HttpConfiguration(uri);
return pool.getHttpConnection(config, connectTimeout);
|
public HttpConnection | getConnection(java.net.URI uri, java.net.Proxy proxy, int connectTimeout)
checkSystemProperties();
HttpConfiguration config = new HttpConfiguration(uri, proxy);
return pool.getHttpConnection(config, connectTimeout);
|
public static org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager | getDefault()Returns the default connection manager
if(defaultConnectionManager == null) {
defaultConnectionManager = new HttpConnectionManager();
}
return defaultConnectionManager;
|
public int | numFreeConnections()
return pool.numFreeConnections();
|
public void | reset()
pool.clear();
|
public void | returnConnectionToPool(HttpConnection connection)
checkSystemProperties();
pool.returnConnection(connection);
|