Class BufferedProxySelector
java.lang.Object
java.net.ProxySelector
com.github.markusbernhardt.proxy.selector.misc.BufferedProxySelector
Implements a cache that can be used to warp it around an existing
ProxySelector. You can specify a maximum cache size and a "time to live" for
positive resolves.
- Author:
- Markus Bernhardt, Copyright 2016, Bernd Rosstauscher, Copyright 2009
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefine the available scopes of the cache key generation -
Constructor Summary
ConstructorsConstructorDescriptionBufferedProxySelector(int maxSize, long ttl, ProxySelector delegate, BufferedProxySelector.CacheScope cacheScope) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectFailed(URI uri, SocketAddress sa, IOException ioe) connectFailedselecttoString()Methods inherited from class java.net.ProxySelector
getDefault, of, setDefault
-
Constructor Details
-
BufferedProxySelector
public BufferedProxySelector(int maxSize, long ttl, ProxySelector delegate, BufferedProxySelector.CacheScope cacheScope) Constructor- Parameters:
maxSize- the max size for the cache.ttl- the "time to live" for cache entries as amount in milliseconds.delegate- the delegate to use.cacheScope- the desired cache scope.
-
-
Method Details
-
toString
-
connectFailed
connectFailed- Specified by:
connectFailedin classProxySelector- See Also:
-
select
select- Specified by:
selectin classProxySelector- See Also:
-