Class SimpleNameResolver<T>

java.lang.Object
io.netty.resolver.SimpleNameResolver<T>
All Implemented Interfaces:
NameResolver<T>, java.io.Closeable, java.lang.AutoCloseable
Direct Known Subclasses:
CompositeNameResolver, InetNameResolver

public abstract class SimpleNameResolver<T> extends java.lang.Object implements NameResolver<T>
A skeletal NameResolver implementation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final EventExecutor
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes all the resources allocated and used by this resolver.
    protected abstract void
    doResolve(java.lang.String inetHost, Promise<T> promise)
    Invoked by resolve(String) to perform the actual name resolution.
    protected abstract void
    doResolveAll(java.lang.String inetHost, Promise<java.util.List<T>> promise)
    Invoked by resolveAll(String) to perform the actual name resolution.
    protected EventExecutor
    Returns the EventExecutor which is used to notify the listeners of the Future returned by resolve(String).
    final Future<T>
    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.
    final Future<java.util.List<T>>
    resolveAll(java.lang.String inetHost)
    Resolves the specified host name and port into a list of address.
    Future<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.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

  • Method Details

    • executor

      protected EventExecutor executor()
      Returns the EventExecutor which is used to notify the listeners of the Future returned by resolve(String).
    • resolve

      public final 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
    • resolve

      public Future<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 final 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
    • resolveAll

      public Future<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
    • doResolve

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

      protected abstract void doResolveAll(java.lang.String inetHost, Promise<java.util.List<T>> promise) throws java.lang.Exception
      Invoked by resolveAll(String) to perform the actual name resolution.
      Throws:
      java.lang.Exception
    • 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>