public class HostNameResolver extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
HostNameResolver.AddressesRingFactory
Factory for the actual host name resolver.
|
| Constructor and Description |
|---|
HostNameResolver()
Builds a resolver with the default (ring) address factory.
|
HostNameResolver(HostNameResolver.AddressesRingFactory addressesRingFactory)
Builds a resolver with the given address factory.
|
| Modifier and Type | Method and Description |
|---|---|
List<InetAddress> |
getAddresses(String hostName)
Calls to this method are thread safe.
|
HostNameResolver.AddressesRingFactory |
getAddressesRingFactory() |
List<InetAddress> |
getRotatedAddresses(String hostName)
Calls to this method are thread safe.
|
public HostNameResolver()
public HostNameResolver(HostNameResolver.AddressesRingFactory addressesRingFactory)
addressesRingFactory - the address factory to usepublic List<InetAddress> getAddresses(String hostName) throws UnknownHostException
hostName - the hostName to resolve addresses for.hostname this object was build with.UnknownHostException - @InetAddress.getAllByName(String)public List<InetAddress> getRotatedAddresses(String hostName) throws UnknownHostException
Two subsequent calls from the same thread may yield the same addresses in the same order.
hostName - the hostName to resolve addresses for.hostname this object was build with.UnknownHostException - @InetAddress.getAllByName(String)public HostNameResolver.AddressesRingFactory getAddressesRingFactory()
Copyright © 2003–2025 MuleSoft, Inc.. All rights reserved.