Package io.netty.resolver
Class SimpleNameResolver<T>
java.lang.Object
io.netty.resolver.SimpleNameResolver<T>
- All Implemented Interfaces:
NameResolver<T>,Closeable,AutoCloseable
- Direct Known Subclasses:
CompositeNameResolver,InetNameResolver
A skeletal
NameResolver implementation.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleNameResolver(io.netty.util.concurrent.EventExecutor executor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes all the resources allocated and used by this resolver.protected abstract voidInvoked byresolve(String)to perform the actual name resolution.protected abstract voiddoResolveAll(String inetHost, io.netty.util.concurrent.Promise<List<T>> promise) Invoked byresolveAll(String)to perform the actual name resolution.protected io.netty.util.concurrent.EventExecutorexecutor()Returns theEventExecutorwhich is used to notify the listeners of theFuturereturned byresolve(String).final io.netty.util.concurrent.Future<T>Resolves the specified name into an address.io.netty.util.concurrent.Future<T>Resolves the specified name into an address.resolveAll(String inetHost) Resolves the specified host name and port into a list of address.resolveAll(String inetHost, io.netty.util.concurrent.Promise<List<T>> promise) Resolves the specified host name and port into a list of address.
-
Constructor Details
-
SimpleNameResolver
protected SimpleNameResolver(io.netty.util.concurrent.EventExecutor executor) - Parameters:
executor- theEventExecutorwhich is used to notify the listeners of theFuturereturned byresolve(String)
-
-
Method Details
-
executor
protected io.netty.util.concurrent.EventExecutor executor()Returns theEventExecutorwhich is used to notify the listeners of theFuturereturned byresolve(String). -
resolve
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 io.netty.util.concurrent.Future<T> resolve(String inetHost, io.netty.util.concurrent.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
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 io.netty.util.concurrent.Future<List<T>> resolveAll(String inetHost, io.netty.util.concurrent.Promise<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(String inetHost, io.netty.util.concurrent.Promise<T> promise) throws Exception Invoked byresolve(String)to perform the actual name resolution.- Throws:
Exception
-
doResolveAll
protected abstract void doResolveAll(String inetHost, io.netty.util.concurrent.Promise<List<T>> promise) throws Exception Invoked byresolveAll(String)to perform the actual name resolution.- Throws:
Exception
-
close
public void close()Description copied from interface:NameResolverCloses all the resources allocated and used by this resolver.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceNameResolver<T>
-