final class InflightNameResolver<T> extends java.lang.Object implements NameResolver<T>
Modifier and Type | Field and Description |
---|---|
private NameResolver<T> |
delegate |
private EventExecutor |
executor |
private java.util.concurrent.ConcurrentMap<java.lang.String,Promise<java.util.List<T>>> |
resolveAllsInProgress |
private java.util.concurrent.ConcurrentMap<java.lang.String,Promise<T>> |
resolvesInProgress |
Constructor and Description |
---|
InflightNameResolver(EventExecutor executor,
NameResolver<T> delegate,
java.util.concurrent.ConcurrentMap<java.lang.String,Promise<T>> resolvesInProgress,
java.util.concurrent.ConcurrentMap<java.lang.String,Promise<java.util.List<T>>> resolveAllsInProgress) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all the resources allocated and used by this resolver.
|
private <U> Promise<U> |
resolve(java.util.concurrent.ConcurrentMap<java.lang.String,Promise<U>> resolveMap,
java.lang.String inetHost,
Promise<U> promise,
boolean resolveAll) |
Future<T> |
resolve(java.lang.String inetHost)
Resolves the specified name into an address.
|
Promise<T> |
resolve(java.lang.String inetHost,
Promise<T> promise)
Resolves the specified name into an address.
|
Future<java.util.List<T>> |
resolveAll(java.lang.String inetHost)
Resolves the specified host name and port into a list of address.
|
Promise<java.util.List<T>> |
resolveAll(java.lang.String inetHost,
Promise<java.util.List<T>> promise)
Resolves the specified host name and port into a list of address.
|
java.lang.String |
toString() |
private static <T> void |
transferResult(Future<T> src,
Promise<T> dst) |
private final EventExecutor executor
private final NameResolver<T> delegate
private final java.util.concurrent.ConcurrentMap<java.lang.String,Promise<T>> resolvesInProgress
InflightNameResolver(EventExecutor executor, NameResolver<T> delegate, java.util.concurrent.ConcurrentMap<java.lang.String,Promise<T>> resolvesInProgress, java.util.concurrent.ConcurrentMap<java.lang.String,Promise<java.util.List<T>>> resolveAllsInProgress)
public Future<T> resolve(java.lang.String inetHost)
NameResolver
resolve
in interface NameResolver<T>
inetHost
- the name to resolvepublic Future<java.util.List<T>> resolveAll(java.lang.String inetHost)
NameResolver
resolveAll
in interface NameResolver<T>
inetHost
- the name to resolvepublic void close()
NameResolver
close
in interface NameResolver<T>
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public Promise<T> resolve(java.lang.String inetHost, Promise<T> promise)
NameResolver
resolve
in interface NameResolver<T>
inetHost
- the name to resolvepromise
- the Promise
which will be fulfilled when the name resolution is finishedpublic Promise<java.util.List<T>> resolveAll(java.lang.String inetHost, Promise<java.util.List<T>> promise)
NameResolver
resolveAll
in interface NameResolver<T>
inetHost
- the name to resolvepromise
- the Promise
which will be fulfilled when the name resolution is finishedprivate <U> Promise<U> resolve(java.util.concurrent.ConcurrentMap<java.lang.String,Promise<U>> resolveMap, java.lang.String inetHost, Promise<U> promise, boolean resolveAll)
public java.lang.String toString()
toString
in class java.lang.Object