Package io.netty.resolver.dns
Class InflightNameResolver<T>
- java.lang.Object
-
- io.netty.resolver.dns.InflightNameResolver<T>
-
- All Implemented Interfaces:
NameResolver<T>,java.io.Closeable,java.lang.AutoCloseable
final class InflightNameResolver<T> extends java.lang.Object implements NameResolver<T>
-
-
Field Summary
Fields Modifier and Type Field Description private NameResolver<T>delegateprivate EventExecutorexecutorprivate java.util.concurrent.ConcurrentMap<java.lang.String,Promise<java.util.List<T>>>resolveAllsInProgressprivate java.util.concurrent.ConcurrentMap<java.lang.String,Promise<T>>resolvesInProgress
-
Constructor Summary
Constructors Constructor 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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes all the resources allocated and used by this resolver.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.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<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.StringtoString()private static <T> voidtransferResult(Future<T> src, Promise<T> dst)
-
-
-
Field Detail
-
executor
private final EventExecutor executor
-
delegate
private final NameResolver<T> delegate
-
resolvesInProgress
private final java.util.concurrent.ConcurrentMap<java.lang.String,Promise<T>> resolvesInProgress
-
-
Constructor Detail
-
InflightNameResolver
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)
-
-
Method Detail
-
resolve
public Future<T> resolve(java.lang.String inetHost)
Description copied from interface:NameResolverResolves the specified name into an address.- Specified by:
resolvein interfaceNameResolver<T>- Parameters:
inetHost- the name to resolve- Returns:
- the address as the result of the resolution
-
resolveAll
public Future<java.util.List<T>> resolveAll(java.lang.String inetHost)
Description copied from interface:NameResolverResolves the specified host name and port into a list of address.- Specified by:
resolveAllin interfaceNameResolver<T>- Parameters:
inetHost- the name to resolve- Returns:
- the list of the address as the result of the resolution
-
close
public void close()
Description copied from interface:NameResolverCloses all the resources allocated and used by this resolver.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceNameResolver<T>
-
resolve
public Promise<T> resolve(java.lang.String inetHost, Promise<T> promise)
Description copied from interface:NameResolverResolves the specified name into an address.- Specified by:
resolvein interfaceNameResolver<T>- Parameters:
inetHost- the name to resolvepromise- thePromisewhich will be fulfilled when the name resolution is finished- Returns:
- the address as the result of the resolution
-
resolveAll
public Promise<java.util.List<T>> resolveAll(java.lang.String inetHost, Promise<java.util.List<T>> promise)
Description copied from interface:NameResolverResolves the specified host name and port into a list of address.- Specified by:
resolveAllin interfaceNameResolver<T>- Parameters:
inetHost- the name to resolvepromise- thePromisewhich will be fulfilled when the name resolution is finished- Returns:
- the list of the address as the result of the resolution
-
resolve
private <U> Promise<U> resolve(java.util.concurrent.ConcurrentMap<java.lang.String,Promise<U>> resolveMap, java.lang.String inetHost, Promise<U> promise, boolean resolveAll)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-