119 sm.checkPermission(SecurityConstants.SET_PROXYSELECTOR_PERMISSION);
120 }
121 theProxySelector = ps;
122 }
123
124 /**
125 * Selects all the applicable proxies based on the protocol to
126 * access the resource with and a destination address to access
127 * the resource at.
128 * The format of the URI is defined as follow:
129 * <UL>
130 * <LI>http URI for http connections</LI>
131 * <LI>https URI for https connections
132 * <LI>{@code socket://host:port}<br>
133 * for tcp client sockets connections</LI>
134 * </UL>
135 *
136 * @param uri
137 * The URI that a connection is required to
138 *
139 * @return a List of Proxies. Each element in the
140 * the List is of type
141 * {@link java.net.Proxy Proxy};
142 * when no proxy is available, the list will
143 * contain one element of type
144 * {@link java.net.Proxy Proxy}
145 * that represents a direct connection.
146 * @throws IllegalArgumentException if the argument is null
147 */
148 public abstract List<Proxy> select(URI uri);
149
150 /**
151 * Called to indicate that a connection could not be established
152 * to a proxy/socks server. An implementation of this method can
153 * temporarily remove the proxies or reorder the sequence of
154 * proxies returned by {@link #select(URI)}, using the address
155 * and the IOException caught when trying to connect.
156 *
157 * @param uri
158 * The URI that the proxy at sa failed to serve.
159 * @param sa
|
119 sm.checkPermission(SecurityConstants.SET_PROXYSELECTOR_PERMISSION);
120 }
121 theProxySelector = ps;
122 }
123
124 /**
125 * Selects all the applicable proxies based on the protocol to
126 * access the resource with and a destination address to access
127 * the resource at.
128 * The format of the URI is defined as follow:
129 * <UL>
130 * <LI>http URI for http connections</LI>
131 * <LI>https URI for https connections
132 * <LI>{@code socket://host:port}<br>
133 * for tcp client sockets connections</LI>
134 * </UL>
135 *
136 * @param uri
137 * The URI that a connection is required to
138 *
139 * @return a List of Proxies. Each element in
140 * the List is of type
141 * {@link java.net.Proxy Proxy};
142 * when no proxy is available, the list will
143 * contain one element of type
144 * {@link java.net.Proxy Proxy}
145 * that represents a direct connection.
146 * @throws IllegalArgumentException if the argument is null
147 */
148 public abstract List<Proxy> select(URI uri);
149
150 /**
151 * Called to indicate that a connection could not be established
152 * to a proxy/socks server. An implementation of this method can
153 * temporarily remove the proxies or reorder the sequence of
154 * proxies returned by {@link #select(URI)}, using the address
155 * and the IOException caught when trying to connect.
156 *
157 * @param uri
158 * The URI that the proxy at sa failed to serve.
159 * @param sa
|