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
resolver构造器和说明 |
---|
RoundRobinInetAddressResolver(EventExecutor executor,
NameResolver<java.net.InetAddress> nameResolver) |
限定符和类型 | 方法和说明 |
---|---|
void |
close()
Closes all the resources allocated and used by this resolver.
|
protected void |
doResolve(java.lang.String inetHost,
Promise<java.net.InetAddress> promise)
Invoked by
SimpleNameResolver.resolve(String) to perform the actual name resolution. |
protected void |
doResolveAll(java.lang.String inetHost,
Promise<java.util.List<java.net.InetAddress>> promise)
Invoked by
SimpleNameResolver.resolveAll(String) to perform the actual name resolution. |
asAddressResolver
executor, resolve, resolve, resolveAll, resolveAll
public RoundRobinInetAddressResolver(EventExecutor executor, NameResolver<java.net.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(java.lang.String inetHost, Promise<java.net.InetAddress> promise) throws java.lang.Exception
SimpleNameResolver
SimpleNameResolver.resolve(String)
to perform the actual name resolution.doResolve
在类中 SimpleNameResolver<java.net.InetAddress>
java.lang.Exception
protected void doResolveAll(java.lang.String inetHost, Promise<java.util.List<java.net.InetAddress>> promise) throws java.lang.Exception
SimpleNameResolver
SimpleNameResolver.resolveAll(String)
to perform the actual name resolution.doResolveAll
在类中 SimpleNameResolver<java.net.InetAddress>
java.lang.Exception
public void close()
NameResolver
close
在接口中 NameResolver<java.net.InetAddress>
close
在接口中 java.io.Closeable
close
在接口中 java.lang.AutoCloseable
close
在类中 SimpleNameResolver<java.net.InetAddress>