Class BaseProxySelector


  • public class BaseProxySelector
    extends java.net.ProxySelector
    The class BaseProxySelector holds a map with proxy addresses. It can replace the default ProxySelector. Example:
     BaseProxySelector proxySelector = new BaseProxySelector(ProxySelector.getDefault(), proxies);
     ProxySelector.setDefault(proxySelector);
     
    The argument proxies is the map with the map of the addresses to be used as proxy.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connectFailed​(java.net.URI uri, java.net.SocketAddress sa, java.io.IOException ioe)
      java.util.List<java.net.Proxy> select​(java.net.URI uri)
      • Methods inherited from class java.net.ProxySelector

        getDefault, of, setDefault
      • Methods inherited from class java.lang.Object

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

      • BaseProxySelector

        public BaseProxySelector​(java.net.ProxySelector defaultSelector,
                                 java.util.Map<java.net.SocketAddress,​ProxyDecorator> proxies)
        Instantiates a new BaseProxySelector.
        Parameters:
        defaultSelector - the default selector
        proxies - the proxies
    • Method Detail

      • connectFailed

        public void connectFailed​(java.net.URI uri,
                                  java.net.SocketAddress sa,
                                  java.io.IOException ioe)
        Specified by:
        connectFailed in class java.net.ProxySelector
      • select

        public java.util.List<java.net.Proxy> select​(java.net.URI uri)
        Specified by:
        select in class java.net.ProxySelector