282447 concurrent destinations in HttpClient
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@640 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
2461a40229
commit
4628a6869c
|
@ -3,6 +3,7 @@ jetty-7.0.0.RC3-SNAPSHOT
|
||||||
+ JETTY-1074 JMX thread manipulation
|
+ JETTY-1074 JMX thread manipulation
|
||||||
+ Improved deferred authentication handling
|
+ Improved deferred authentication handling
|
||||||
+ 285697 extract parameters if dispatch has query
|
+ 285697 extract parameters if dispatch has query
|
||||||
|
+ 282447 concurrent destinations in HttpClient
|
||||||
|
|
||||||
jetty-7.0.0.RC2 29 June 2009
|
jetty-7.0.0.RC2 29 June 2009
|
||||||
+ 283844 Webapp / TLD errors are not clear
|
+ 283844 Webapp / TLD errors are not clear
|
||||||
|
|
|
@ -23,6 +23,8 @@ import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.ConcurrentMap;
|
||||||
|
|
||||||
import javax.net.ssl.HostnameVerifier;
|
import javax.net.ssl.HostnameVerifier;
|
||||||
import javax.net.ssl.KeyManager;
|
import javax.net.ssl.KeyManager;
|
||||||
|
@ -86,7 +88,7 @@ public class HttpClient extends HttpBuffers implements Attributes
|
||||||
private int _connectorType = CONNECTOR_SELECT_CHANNEL;
|
private int _connectorType = CONNECTOR_SELECT_CHANNEL;
|
||||||
private boolean _useDirectBuffers = true;
|
private boolean _useDirectBuffers = true;
|
||||||
private int _maxConnectionsPerAddress = Integer.MAX_VALUE;
|
private int _maxConnectionsPerAddress = Integer.MAX_VALUE;
|
||||||
private Map<Address, HttpDestination> _destinations = new HashMap<Address, HttpDestination>();
|
private ConcurrentMap<Address, HttpDestination> _destinations = new ConcurrentHashMap<Address, HttpDestination>();
|
||||||
ThreadPool _threadPool;
|
ThreadPool _threadPool;
|
||||||
Connector _connector;
|
Connector _connector;
|
||||||
private long _idleTimeout = 20000;
|
private long _idleTimeout = 20000;
|
||||||
|
@ -222,22 +224,21 @@ public class HttpClient extends HttpBuffers implements Attributes
|
||||||
if (remote == null)
|
if (remote == null)
|
||||||
throw new UnknownHostException("Remote socket address cannot be null.");
|
throw new UnknownHostException("Remote socket address cannot be null.");
|
||||||
|
|
||||||
synchronized (_destinations)
|
HttpDestination destination = _destinations.get(remote);
|
||||||
|
if (destination == null)
|
||||||
{
|
{
|
||||||
HttpDestination destination = _destinations.get(remote);
|
destination = new HttpDestination(this, remote, ssl, _maxConnectionsPerAddress);
|
||||||
if (destination == null)
|
if (_proxy != null && (_noProxy == null || !_noProxy.contains(remote.getHost())))
|
||||||
{
|
{
|
||||||
destination = new HttpDestination(this, remote, ssl, _maxConnectionsPerAddress);
|
destination.setProxy(_proxy);
|
||||||
if (_proxy != null && (_noProxy == null || !_noProxy.contains(remote.getHost())))
|
if (_proxyAuthentication != null)
|
||||||
{
|
destination.setProxyAuthentication(_proxyAuthentication);
|
||||||
destination.setProxy(_proxy);
|
|
||||||
if (_proxyAuthentication != null)
|
|
||||||
destination.setProxyAuthentication(_proxyAuthentication);
|
|
||||||
}
|
|
||||||
_destinations.put(remote, destination);
|
|
||||||
}
|
}
|
||||||
return destination;
|
HttpDestination other =_destinations.putIfAbsent(remote, destination);
|
||||||
|
if (other!=null)
|
||||||
|
destination=other;
|
||||||
}
|
}
|
||||||
|
return destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
|
|
Loading…
Reference in New Issue