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.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes all the resources allocated and used by this resolver.protected abstract void
Invoked byresolve(String)
to perform the actual name resolution.protected abstract void
doResolveAll
(String inetHost, Promise<List<T>> promise) Invoked byresolveAll(String)
to perform the actual name resolution.protected EventExecutor
executor()
Returns theEventExecutor
which is used to notify the listeners of theFuture
returned byresolve(String)
.Resolves the specified name into an address.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, Promise<List<T>> promise) Resolves the specified host name and port into a list of address.
-
Field Details
-
executor
-
-
Constructor Details
-
SimpleNameResolver
- Parameters:
executor
- theEventExecutor
which is used to notify the listeners of theFuture
returned byresolve(String)
-
-
Method Details
-
executor
Returns theEventExecutor
which is used to notify the listeners of theFuture
returned byresolve(String)
. -
resolve
Description copied from interface:NameResolver
Resolves the specified name into an address.- Specified by:
resolve
in interfaceNameResolver<T>
- Parameters:
inetHost
- the name to resolve- Returns:
- the address as the result of the resolution
-
resolve
Description copied from interface:NameResolver
Resolves the specified name into an address.- Specified by:
resolve
in interfaceNameResolver<T>
- Parameters:
inetHost
- the name to resolvepromise
- thePromise
which will be fulfilled when the name resolution is finished- Returns:
- the address as the result of the resolution
-
resolveAll
Description copied from interface:NameResolver
Resolves the specified host name and port into a list of address.- Specified by:
resolveAll
in interfaceNameResolver<T>
- Parameters:
inetHost
- the name to resolve- Returns:
- the list of the address as the result of the resolution
-
resolveAll
Description copied from interface:NameResolver
Resolves the specified host name and port into a list of address.- Specified by:
resolveAll
in interfaceNameResolver<T>
- Parameters:
inetHost
- the name to resolvepromise
- thePromise
which will be fulfilled when the name resolution is finished- Returns:
- the list of the address as the result of the resolution
-
doResolve
Invoked byresolve(String)
to perform the actual name resolution.- Throws:
Exception
-
doResolveAll
Invoked byresolveAll(String)
to perform the actual name resolution.- Throws:
Exception
-
close
public void close()Description copied from interface:NameResolver
Closes all the resources allocated and used by this resolver.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceNameResolver<T>
-