public class NameCache extends Object implements Cache<Identifier,InetSocketAddress>
Constructor and Description |
---|
NameCache(long timeout)
Constructs a naming cache.
|
Modifier and Type | Method and Description |
---|---|
InetSocketAddress |
get(Identifier key,
Callable<InetSocketAddress> valueFetcher)
Gets an address for an identifier.
|
void |
invalidate(Identifier key)
Invalidates the entry for an identifier.
|
public NameCache(long timeout)
timeout
- a cache entry timeout after writepublic InetSocketAddress get(Identifier key, Callable<InetSocketAddress> valueFetcher) throws ExecutionException
get
in interface Cache<Identifier,InetSocketAddress>
key
- an identifiervalueFetcher
- a callable to load a value for the corresponding identifierExecutionException
public void invalidate(Identifier key)
invalidate
in interface Cache<Identifier,InetSocketAddress>
key
- an identifierCopyright © 2017 The Apache Software Foundation. All rights reserved.