@UnstableApi public class RoundRobinInetAddressResolver extends InetNameResolver
NameResolver
that resolves InetAddress
and force Round Robin by choosing a single address
randomly in SimpleNameResolver.resolve(String)
and SimpleNameResolver.resolve(String, Promise)
if multiple are returned by the NameResolver
.
Use InetNameResolver.asAddressResolver()
to create a InetSocketAddress
resolverConstructor and Description |
---|
RoundRobinInetAddressResolver(EventExecutor executor,
NameResolver<InetAddress> nameResolver) |
Modifier and Type | Method and Description |
---|---|
protected void |
doResolve(String inetHost,
Promise<InetAddress> promise)
Invoked by
SimpleNameResolver.resolve(String) to perform the actual name resolution. |
protected void |
doResolveAll(String inetHost,
Promise<List<InetAddress>> promise)
Invoked by
SimpleNameResolver.resolveAll(String) to perform the actual name resolution. |
asAddressResolver
close, executor, resolve, resolve, resolveAll, resolveAll
public RoundRobinInetAddressResolver(EventExecutor executor, NameResolver<InetAddress> nameResolver)
executor
- the EventExecutor
which is used to notify the listeners of the Future
returned by
SimpleNameResolver.resolve(String)
nameResolver
- the NameResolver
used for name resolutionprotected void doResolve(String inetHost, Promise<InetAddress> promise) throws Exception
SimpleNameResolver
SimpleNameResolver.resolve(String)
to perform the actual name resolution.doResolve
in class SimpleNameResolver<InetAddress>
Exception
protected void doResolveAll(String inetHost, Promise<List<InetAddress>> promise) throws Exception
SimpleNameResolver
SimpleNameResolver.resolveAll(String)
to perform the actual name resolution.doResolveAll
in class SimpleNameResolver<InetAddress>
Exception
Copyright © 2008–2017 The Netty Project. All rights reserved.