Class PacProxySelector


  • public class PacProxySelector
    extends java.net.ProxySelector
    ProxySelector that will use a PAC script to find an proxy for a given URI.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connectFailed​(java.net.URI uri, java.net.SocketAddress sa, java.io.IOException ioe)
      connectFailed
      static boolean isEnabled()
      Checks if the selector is currently enabled.
      java.util.List<java.net.Proxy> select​(java.net.URI uri)
      select
      static void setEnabled​(boolean enable)
      Can be used to enable / disable the proxy selector.
      • 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

      • PacProxySelector

        public PacProxySelector​(PacScriptSource pacSource)
        Constructor
        Parameters:
        pacSource - the source for the PAC file.
    • Method Detail

      • setEnabled

        public static void setEnabled​(boolean enable)
        Can be used to enable / disable the proxy selector. If disabled it will return DIRECT for all urls.
        Parameters:
        enable - the new status to set.
      • isEnabled

        public static boolean isEnabled()
        Checks if the selector is currently enabled.
        Returns:
        true if enabled else false.
      • connectFailed

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

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