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 final NameResolver<T>
     
    private final EventExecutor
     
    private final java.util.concurrent.ConcurrentMap<java.lang.String, Promise<java.util.List<T>>>
     
    private final java.util.concurrent.ConcurrentMap<java.lang.String, Promise<T>>
     
  • 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

    Modifier and Type
    Method
    Description
    void
    Closes all the resources allocated and used by this resolver.
    resolve(java.lang.String inetHost)
    Resolves the specified name into an address.
    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
     
    private static <T> void
    transferResult(Future<T> src, Promise<T> dst)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • executor

      private final EventExecutor executor
    • delegate

      private final NameResolver<T> delegate
    • resolvesInProgress

      private final java.util.concurrent.ConcurrentMap<java.lang.String, Promise<T>> resolvesInProgress
    • resolveAllsInProgress

      private final java.util.concurrent.ConcurrentMap<java.lang.String, Promise<java.util.List<T>>> resolveAllsInProgress
  • Constructor Details

    • 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 Details

    • 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 interface NameResolver<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 interface NameResolver<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 interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable
      Specified by:
      close in interface NameResolver<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 interface NameResolver<T>
      Parameters:
      inetHost - the name to resolve
      promise - the Promise 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 interface NameResolver<T>
      Parameters:
      inetHost - the name to resolve
      promise - the Promise 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)
    • transferResult

      private static <T> void transferResult(Future<T> src, Promise<T> dst)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object