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 |
---|---|
void |
close()
Closes all the resources allocated and used by this resolver.
|
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
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
public void close()
NameResolver
close
in interface NameResolver<InetAddress>
close
in interface Closeable
close
in interface AutoCloseable
close
in class SimpleNameResolver<InetAddress>
Copyright © 2008–2024 The Netty Project. All rights reserved.