org.littleshoot.util
Class ResettingMultiThreadedHttpConnectionManager

java.lang.Object
  extended by org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
      extended by org.littleshoot.util.ResettingMultiThreadedHttpConnectionManager
All Implemented Interfaces:
org.apache.commons.httpclient.HttpConnectionManager

public class ResettingMultiThreadedHttpConnectionManager
extends org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

This is a connection manager that just resets HTTP and HTTPS protocol handling back to the default. This is an odd case, but useful when your code includes other libraries that set custom HTTP protocol handlers. You often don't want to use those custom handlers, but you don't want to affect the integrity of the third-party library through resetting the protocol handlers globally. This successfully overrides those settings without external effects.


Field Summary
 
Fields inherited from class org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
DEFAULT_MAX_HOST_CONNECTIONS, DEFAULT_MAX_TOTAL_CONNECTIONS
 
Constructor Summary
ResettingMultiThreadedHttpConnectionManager()
           
 
Method Summary
 org.apache.commons.httpclient.HttpConnection getConnection(org.apache.commons.httpclient.HostConfiguration hc)
           
 org.apache.commons.httpclient.HttpConnection getConnectionWithTimeout(org.apache.commons.httpclient.HostConfiguration hc, long timeout)
           
 
Methods inherited from class org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
closeIdleConnections, deleteClosedConnections, getConnection, getConnectionsInPool, getConnectionsInPool, getConnectionsInUse, getConnectionsInUse, getMaxConnectionsPerHost, getMaxTotalConnections, getParams, isConnectionStaleCheckingEnabled, releaseConnection, setConnectionStaleCheckingEnabled, setMaxConnectionsPerHost, setMaxTotalConnections, setParams, shutdown, shutdownAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResettingMultiThreadedHttpConnectionManager

public ResettingMultiThreadedHttpConnectionManager()
Method Detail

getConnection

public org.apache.commons.httpclient.HttpConnection getConnection(org.apache.commons.httpclient.HostConfiguration hc)
Specified by:
getConnection in interface org.apache.commons.httpclient.HttpConnectionManager
Overrides:
getConnection in class org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

getConnectionWithTimeout

public org.apache.commons.httpclient.HttpConnection getConnectionWithTimeout(org.apache.commons.httpclient.HostConfiguration hc,
                                                                             long timeout)
                                                                      throws org.apache.commons.httpclient.ConnectionPoolTimeoutException
Specified by:
getConnectionWithTimeout in interface org.apache.commons.httpclient.HttpConnectionManager
Overrides:
getConnectionWithTimeout in class org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
Throws:
org.apache.commons.httpclient.ConnectionPoolTimeoutException


Copyright © 2011-2013 LittleShoot. All Rights Reserved.