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.
- Author:
- Markus Bernhardt, Copyright 2016, Bernd Rosstauscher, Copyright 2009
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectFailed(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.selectvoidsetFallbackSelector(ProxySelector selector) Sets the fallback selector that is always called when no matching protocol selector was found..voidsetSelector(String protocol, ProxySelector selector) Sets a selector responsible for the given protocol.intsize()Gets the size of the selector map.toString()Methods inherited from class java.net.ProxySelector
getDefault, of, setDefault
-
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:
connectFailedin classProxySelector- See Also:
-
select
select- Specified by:
selectin classProxySelector- See Also:
-
size
public int size()Gets the size of the selector map.- Returns:
- the size of the selector map.
-
toString
-