Class AbstractAddressResolver<T extends SocketAddress>

java.lang.Object
io.netty.resolver.AbstractAddressResolver<T>
All Implemented Interfaces:
AddressResolver<T>, Closeable, AutoCloseable
Direct Known Subclasses:
InetSocketAddressResolver, NoopAddressResolver

public abstract class AbstractAddressResolver<T extends SocketAddress> extends Object implements AddressResolver<T>
A skeletal AddressResolver implementation.
  • Constructor Details

    • AbstractAddressResolver

      protected AbstractAddressResolver(io.netty.util.concurrent.EventExecutor executor)
      Parameters:
      executor - the EventExecutor which is used to notify the listeners of the Future returned by resolve(SocketAddress)
    • AbstractAddressResolver

      protected AbstractAddressResolver(io.netty.util.concurrent.EventExecutor executor, 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 Details

    • executor

      protected io.netty.util.concurrent.EventExecutor executor()
      Returns the EventExecutor which is used to notify the listeners of the Future returned by resolve(SocketAddress).
    • isSupported

      public boolean isSupported(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 SocketAddress>
    • isResolved

      public final boolean isResolved(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 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 io.netty.util.concurrent.Future<T> resolve(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 SocketAddress>
      Parameters:
      address - the address to resolve
      Returns:
      the SocketAddress as the result of the resolution
    • resolve

      public final io.netty.util.concurrent.Future<T> resolve(SocketAddress address, io.netty.util.concurrent.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 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 io.netty.util.concurrent.Future<List<T>> resolveAll(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 SocketAddress>
      Parameters:
      address - the address to resolve
      Returns:
      the list of the SocketAddresses as the result of the resolution
    • resolveAll

      public final io.netty.util.concurrent.Future<List<T>> resolveAll(SocketAddress address, io.netty.util.concurrent.Promise<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 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, io.netty.util.concurrent.Promise<T> promise) throws Exception
      Invoked by resolve(SocketAddress) to perform the actual name resolution.
      Throws:
      Exception
    • doResolveAll

      protected abstract void doResolveAll(T unresolvedAddress, io.netty.util.concurrent.Promise<List<T>> promise) throws Exception
      Invoked by resolveAll(SocketAddress) to perform the actual name resolution.
      Throws:
      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 SocketAddress>
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable