Class AbstractAddressResolver<T extends java.net.SocketAddress>

    • Constructor Detail

      • AbstractAddressResolver

        protected AbstractAddressResolver​(EventExecutor executor,
                                          java.lang.Class<? extends T> addressType)
        Parameters:
        executor - the EventExecutor which is used to notify the listeners of the Future returned by resolve(SocketAddress)
        addressType - the type of the SocketAddress supported by this resolver
    • Method Detail

      • isSupported

        public boolean isSupported​(java.net.SocketAddress address)
        Description copied from interface: AddressResolver
        Returns true if and only if the specified address is supported by this resolved.
        Specified by:
        isSupported in interface AddressResolver<T extends java.net.SocketAddress>
      • isResolved

        public final boolean isResolved​(java.net.SocketAddress address)
        Description copied from interface: AddressResolver
        Returns true if and only if the specified address has been resolved.
        Specified by:
        isResolved in interface AddressResolver<T extends java.net.SocketAddress>
      • doIsResolved

        protected abstract boolean doIsResolved​(T address)
        Invoked by isResolved(SocketAddress) to check if the specified address has been resolved already.
      • resolve

        public final Future<T> resolve​(java.net.SocketAddress address)
        Description copied from interface: AddressResolver
        Resolves the specified address. If the specified address is resolved already, this method does nothing but returning the original address.
        Specified by:
        resolve in interface AddressResolver<T extends java.net.SocketAddress>
        Parameters:
        address - the address to resolve
        Returns:
        the SocketAddress as the result of the resolution
      • resolve

        public final Future<T> resolve​(java.net.SocketAddress address,
                                       Promise<T> promise)
        Description copied from interface: AddressResolver
        Resolves the specified address. If the specified address is resolved already, this method does nothing but returning the original address.
        Specified by:
        resolve in interface AddressResolver<T extends java.net.SocketAddress>
        Parameters:
        address - the address to resolve
        promise - the Promise which will be fulfilled when the name resolution is finished
        Returns:
        the SocketAddress as the result of the resolution
      • resolveAll

        public final Future<java.util.List<T>> resolveAll​(java.net.SocketAddress address)
        Description copied from interface: AddressResolver
        Resolves the specified address. If the specified address is resolved already, this method does nothing but returning the original address.
        Specified by:
        resolveAll in interface AddressResolver<T extends java.net.SocketAddress>
        Parameters:
        address - the address to resolve
        Returns:
        the list of the SocketAddresses as the result of the resolution
      • resolveAll

        public final Future<java.util.List<T>> resolveAll​(java.net.SocketAddress address,
                                                          Promise<java.util.List<T>> promise)
        Description copied from interface: AddressResolver
        Resolves the specified address. If the specified address is resolved already, this method does nothing but returning the original address.
        Specified by:
        resolveAll in interface AddressResolver<T extends java.net.SocketAddress>
        Parameters:
        address - the address to resolve
        promise - the Promise which will be fulfilled when the name resolution is finished
        Returns:
        the list of the SocketAddresses as the result of the resolution
      • doResolve

        protected abstract void doResolve​(T unresolvedAddress,
                                          Promise<T> promise)
                                   throws java.lang.Exception
        Invoked by resolve(SocketAddress) to perform the actual name resolution.
        Throws:
        java.lang.Exception
      • doResolveAll

        protected abstract void doResolveAll​(T unresolvedAddress,
                                             Promise<java.util.List<T>> promise)
                                      throws java.lang.Exception
        Invoked by resolveAll(SocketAddress) to perform the actual name resolution.
        Throws:
        java.lang.Exception
      • close

        public void close()
        Description copied from interface: AddressResolver
        Closes all the resources allocated and used by this resolver.
        Specified by:
        close in interface AddressResolver<T extends java.net.SocketAddress>
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable