public class AddressCache extends Object
InetSocketAddresses.
This will prevent the creation of a new InetSocketAddress every time, but will configure expiry
consistent with the JVM networkaddress.cache.ttl setting.
e.g. if networkaddress.cache.ttl is set to:
Note: This will default to caching addresses forever when no value is specified for networkaddress.cache.ttl, as per the documentation, that default may differ from the JVM default when no security manager is installed.
| Constructor and Description |
|---|
AddressCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String description,
String hostname,
int port) |
void |
clear() |
InetSocketAddress |
lookup(String description) |
public InetSocketAddress lookup(String description)
public void clear()
Copyright © 2023. All rights reserved.