Package io.netty.resolver
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 skeletalNameResolverimplementation.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleNameResolver(EventExecutor executor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()Closes all the resources allocated and used by this resolver.protected abstract voiddoResolve(java.lang.String inetHost, Promise<T> promise)Invoked byresolve(String)to perform the actual name resolution.protected abstract voiddoResolveAll(java.lang.String inetHost, Promise<java.util.List<T>> promise)Invoked byresolveAll(String)to perform the actual name resolution.protected EventExecutorexecutor()Returns theEventExecutorwhich is used to notify the listeners of theFuturereturned byresolve(String).Future<T>resolve(java.lang.String inetHost)Resolves the specified name into an address.Future<T>resolve(java.lang.String inetHost, Promise<T> promise)Resolves the specified name into an address.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.
-
-
-
Constructor Detail
-
SimpleNameResolver
protected SimpleNameResolver(EventExecutor executor)
- Parameters:
executor- theEventExecutorwhich is used to notify the listeners of theFuturereturned byresolve(String)
-
-
Method Detail
-
executor
protected EventExecutor executor()
Returns theEventExecutorwhich is used to notify the listeners of theFuturereturned byresolve(String).
-
resolve
public final Future<T> resolve(java.lang.String inetHost)
Description copied from interface:NameResolverResolves the specified name into an address.- Specified by:
resolvein interfaceNameResolver<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:NameResolverResolves the specified name into an address.- Specified by:
resolvein interfaceNameResolver<T>- Parameters:
inetHost- the name to resolvepromise- thePromisewhich 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:NameResolverResolves the specified host name and port into a list of address.- Specified by:
resolveAllin interfaceNameResolver<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:NameResolverResolves the specified host name and port into a list of address.- Specified by:
resolveAllin interfaceNameResolver<T>- Parameters:
inetHost- the name to resolvepromise- thePromisewhich 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.ExceptionInvoked byresolve(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.ExceptionInvoked byresolveAll(String)to perform the actual name resolution.- Throws:
java.lang.Exception
-
close
public void close()
Description copied from interface:NameResolverCloses all the resources allocated and used by this resolver.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceNameResolver<T>
-
-