Class InflightNameResolver<T>

  • All Implemented Interfaces:
    NameResolver<T>, java.io.Closeable, java.lang.AutoCloseable

    final class InflightNameResolver<T>
    extends java.lang.Object
    implements NameResolver<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

      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)  
      • Methods inherited from class java.lang.Object

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

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