Class SystemDefaultRoutePlanner

  • All Implemented Interfaces:
    HttpRoutePlanner

    @Contract(threading=IMMUTABLE_CONDITIONAL)
    public class SystemDefaultRoutePlanner
    extends DefaultRoutePlanner
    HttpRoutePlanner implementation based on ProxySelector. By default, this class will pick up the proxy settings of the JVM, either from system properties or from the browser running the application.
    Since:
    4.3
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.net.ProxySelector proxySelector  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.net.Proxy chooseProxy​(java.util.List<java.net.Proxy> proxies)  
      protected org.apache.http.HttpHost determineProxy​(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context)
      This implementation returns null.
      private java.lang.String getHost​(java.net.InetSocketAddress isa)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • proxySelector

        private final java.net.ProxySelector proxySelector
    • Constructor Detail

      • SystemDefaultRoutePlanner

        public SystemDefaultRoutePlanner​(SchemePortResolver schemePortResolver,
                                         java.net.ProxySelector proxySelector)
        Parameters:
        proxySelector - the proxy selector, or null for the system default
      • SystemDefaultRoutePlanner

        public SystemDefaultRoutePlanner​(java.net.ProxySelector proxySelector)
        Parameters:
        proxySelector - the proxy selector, or null for the system default
    • Method Detail

      • determineProxy

        protected org.apache.http.HttpHost determineProxy​(org.apache.http.HttpHost target,
                                                          org.apache.http.HttpRequest request,
                                                          org.apache.http.protocol.HttpContext context)
                                                   throws org.apache.http.HttpException
        Description copied from class: DefaultRoutePlanner
        This implementation returns null.
        Overrides:
        determineProxy in class DefaultRoutePlanner
        Throws:
        org.apache.http.HttpException - may be thrown if overridden
      • getHost

        private java.lang.String getHost​(java.net.InetSocketAddress isa)
      • chooseProxy

        private java.net.Proxy chooseProxy​(java.util.List<java.net.Proxy> proxies)