@UnstableApi public class RoundRobinInetAddressResolver extends InetNameResolver
NameResolver
解析InetAddress
并通过在SimpleNameResolver.resolve(String)
和SimpleNameResolver.resolve(String, Promise)
中随机选择单个地址(如果NameResolver
返回多个地址)来强制循环播放 。
使用InetNameResolver.asAddressResolver()
创建一个InetSocketAddress
解析器
Constructor and Description |
---|
RoundRobinInetAddressResolver(EventExecutor executor, NameResolver<java.net.InetAddress> nameResolver) |
Modifier and Type | Method and Description |
---|---|
protected void |
doResolve(java.lang.String inetHost, Promise<java.net.InetAddress> promise)
由
SimpleNameResolver.resolve(String) 调用来执行实际的名称解析。
|
protected void |
doResolveAll(java.lang.String inetHost, Promise<java.util.List<java.net.InetAddress>> promise)
由
SimpleNameResolver.resolveAll(String) 调用以执行实际的名称解析。
|
asAddressResolver
close, executor, resolve, resolve, resolveAll, resolveAll
public RoundRobinInetAddressResolver(EventExecutor executor, NameResolver<java.net.InetAddress> nameResolver)
executor
-所述EventExecutor
这是用来通知的听众Future
通过返回SimpleNameResolver.resolve(String)
nameResolver
- 用于名称解析的NameResolver
protected void doResolve(java.lang.String inetHost, Promise<java.net.InetAddress> promise) throws java.lang.Exception
SimpleNameResolver
SimpleNameResolver.resolve(String)
调用以执行实际的名称解析。
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)
调用来执行实际的名称解析。
doResolveAll
在课堂上
SimpleNameResolver<java.net.InetAddress>
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.