Class ProtocolDispatchSelector
java.lang.Object
java.net.ProxySelector
com.github.markusbernhardt.proxy.selector.misc.ProtocolDispatchSelector
This is a facade for a list of ProxySelecor objects. You can register
different ProxySelectors per Protocol.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
connectFailed
(URI uri, SocketAddress sa, IOException ioe) connectFailedgetSelector
(String protocol) Gets the selector installed for the given protocol.removeSelector
(String protocol) Removes the selector installed for the given protocol.selectvoid
setFallbackSelector
(ProxySelector selector) Sets the fallback selector that is always called when no matching protocol selector was found..void
setSelector
(String protocol, ProxySelector selector) Sets a selector responsible for the given protocol.int
size()
Gets the size of the selector map.toString()
Methods inherited from class java.net.ProxySelector
getDefault, of, setDefault
-
Field Details
-
selectors
-
fallbackSelector
-
-
Constructor Details
-
ProtocolDispatchSelector
public ProtocolDispatchSelector()Constructor
-
-
Method Details
-
setSelector
Sets a selector responsible for the given protocol.- Parameters:
protocol
- the name of the protocol.selector
- the selector to use.
-
removeSelector
Removes the selector installed for the given protocol.- Parameters:
protocol
- the protocol name.- Returns:
- the old selector that is removed.
-
getSelector
Gets the selector installed for the given protocol.- Parameters:
protocol
- the protocol name.- Returns:
- the selector for that protocol, null if none is currently set.
-
setFallbackSelector
Sets the fallback selector that is always called when no matching protocol selector was found..- Parameters:
selector
- the selector to use.
-
connectFailed
connectFailed- Specified by:
connectFailed
in classProxySelector
- See Also:
-
select
select- Specified by:
select
in classProxySelector
- See Also:
-
size
public int size()Gets the size of the selector map.- Returns:
- the size of the selector map.
-
toString
-