public class RoundRobinDnsAddressResolverGroup extends DnsAddressResolverGroup
AddressResolverGroup
of DnsNameResolver
s that supports random selection of destination addresses if
multiple are provided by the nameserver. This is ideal for use in applications that use a pool of connections, for
which connecting to a single resolved address would be inefficient.构造器和说明 |
---|
RoundRobinDnsAddressResolverGroup(ChannelFactory<? extends DatagramChannel> channelFactory,
DnsServerAddressStreamProvider nameServerProvider) |
RoundRobinDnsAddressResolverGroup(java.lang.Class<? extends DatagramChannel> channelType,
DnsServerAddressStreamProvider nameServerProvider) |
RoundRobinDnsAddressResolverGroup(DnsNameResolverBuilder dnsResolverBuilder) |
限定符和类型 | 方法和说明 |
---|---|
protected AddressResolver<java.net.InetSocketAddress> |
newAddressResolver(EventLoop eventLoop,
NameResolver<java.net.InetAddress> resolver)
We need to override this method, not
DnsAddressResolverGroup.newNameResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider) ,
because we need to eliminate possible caching of NameResolver.resolve(java.lang.String)
by InflightNameResolver created in
DnsAddressResolverGroup.newResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider) . |
newNameResolver, newResolver, newResolver
close, getResolver
public RoundRobinDnsAddressResolverGroup(DnsNameResolverBuilder dnsResolverBuilder)
public RoundRobinDnsAddressResolverGroup(java.lang.Class<? extends DatagramChannel> channelType, DnsServerAddressStreamProvider nameServerProvider)
public RoundRobinDnsAddressResolverGroup(ChannelFactory<? extends DatagramChannel> channelFactory, DnsServerAddressStreamProvider nameServerProvider)
protected final AddressResolver<java.net.InetSocketAddress> newAddressResolver(EventLoop eventLoop, NameResolver<java.net.InetAddress> resolver) throws java.lang.Exception
DnsAddressResolverGroup.newNameResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider)
,
because we need to eliminate possible caching of NameResolver.resolve(java.lang.String)
by InflightNameResolver
created in
DnsAddressResolverGroup.newResolver(EventLoop, ChannelFactory, DnsServerAddressStreamProvider)
.newAddressResolver
在类中 DnsAddressResolverGroup
java.lang.Exception