Class BufferedProxySelector
- java.lang.Object
-
- java.net.ProxySelector
-
- com.github.markusbernhardt.proxy.selector.misc.BufferedProxySelector
-
public class BufferedProxySelector extends ProxySelector
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 Classes Modifier and Type Class Description static classBufferedProxySelector.CacheScopeDefine the available scopes of the cache key generation
-
Constructor Summary
Constructors Constructor Description BufferedProxySelector(int maxSize, long ttl, ProxySelector delegate, BufferedProxySelector.CacheScope cacheScope)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnectFailed(URI uri, SocketAddress sa, IOException ioe)connectFailedList<Proxy>select(URI uri)selectStringtoString()-
Methods inherited from class java.net.ProxySelector
getDefault, of, setDefault
-
-
-
-
Constructor Detail
-
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 Detail
-
connectFailed
public void connectFailed(URI uri, SocketAddress sa, IOException ioe)
connectFailed- Specified by:
connectFailedin classProxySelector- See Also:
ProxySelector.connectFailed(java.net.URI, java.net.SocketAddress, java.io.IOException)
-
select
public List<Proxy> select(URI uri)
select- Specified by:
selectin classProxySelector- See Also:
ProxySelector.select(java.net.URI)
-
-