NameResolver that resolves InetAddress and force Round Robin by choosing a single address
randomly in resolve(String) and resolve(String, Promise)
if multiple are returned by the NameResolver.
Use asAddressResolver() to create a InetSocketAddress resolver
| Modifier and Type | Field and Description |
|---|---|
| private final NameResolver |
| Access | Constructor and Description |
|---|---|
| public | RoundRobinInetAddressResolver(EventExecutor executor, NameResolver<InetAddress>
the nameResolver)NameResolver used for name resolution
|
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides io. Implements io. |
| protected void | doResolve(final String inetHost, final Promise<InetAddress> promise)
Implements abstract io. resolve(String) to perform the actual name resolution.
|
| protected void | doResolveAll(String inetHost, final Promise<List<InetAddress>> promise)
Implements abstract io. resolveAll(String) to perform the actual name resolution.
|
| private static int |
| nameResolver | back to summary |
|---|---|
| private final NameResolver<InetAddress> nameResolver | |
| RoundRobinInetAddressResolver | back to summary |
|---|---|
public RoundRobinInetAddressResolver(EventExecutor executor, NameResolver<InetAddress> nameResolver)
| |
| close | back to summary |
|---|---|
| public void close() Overrides io. Implements io. Doc from io. Closes all the resources allocated and used by this resolver.
| |
| doResolve | back to summary |
|---|---|
| protected void doResolve(final String inetHost, final Promise<InetAddress> promise) throws Exception Implements abstract io. Doc from io. Invoked by
| |
| doResolveAll | back to summary |
|---|---|
| protected void doResolveAll(String inetHost, final Promise<List<InetAddress>> promise) throws Exception Implements abstract io. Doc from io. Invoked by
| |
| randomIndex | back to summary |
|---|---|
| private static int randomIndex(int numAddresses) | |