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>
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 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 void
close()
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.String
toString()
private static <T> void
transferResult(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:NameResolver
Resolves the specified name into an address.- Specified by:
resolve
in 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:NameResolver
Resolves the specified host name and port into a list of address.- Specified by:
resolveAll
in 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:NameResolver
Closes all the resources allocated and used by this resolver.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfaceNameResolver<T>
-
resolve
public Promise<T> resolve(java.lang.String inetHost, Promise<T> promise)
Description copied from interface:NameResolver
Resolves the specified name into an address.- Specified by:
resolve
in interfaceNameResolver<T>
- Parameters:
inetHost
- the name to resolvepromise
- thePromise
which 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:NameResolver
Resolves the specified host name and port into a list of address.- Specified by:
resolveAll
in interfaceNameResolver<T>
- Parameters:
inetHost
- the name to resolvepromise
- thePromise
which 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:
toString
in classjava.lang.Object
-
-