Package io.netty.resolver
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.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractAddressResolver
(EventExecutor executor) protected
AbstractAddressResolver
(EventExecutor executor, Class<? extends T> addressType) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes all the resources allocated and used by this resolver.protected abstract boolean
doIsResolved
(T address) Invoked byisResolved(SocketAddress)
to check if the specifiedaddress
has been resolved already.protected abstract void
Invoked byresolve(SocketAddress)
to perform the actual name resolution.protected abstract void
doResolveAll
(T unresolvedAddress, Promise<List<T>> promise) Invoked byresolveAll(SocketAddress)
to perform the actual name resolution.protected EventExecutor
executor()
Returns theEventExecutor
which is used to notify the listeners of theFuture
returned byresolve(SocketAddress)
.final boolean
isResolved
(SocketAddress address) Returnstrue
if and only if the specified address has been resolved.boolean
isSupported
(SocketAddress address) Returnstrue
if and only if the specified address is supported by this resolved.resolve
(SocketAddress address) Resolves the specified address.resolve
(SocketAddress address, Promise<T> promise) Resolves the specified address.resolveAll
(SocketAddress address) Resolves the specified address.resolveAll
(SocketAddress address, Promise<List<T>> promise) Resolves the specified address.
-
Field Details
-
executor
-
matcher
-
-
Constructor Details
-
AbstractAddressResolver
- Parameters:
executor
- theEventExecutor
which is used to notify the listeners of theFuture
returned byresolve(SocketAddress)
-
AbstractAddressResolver
- Parameters:
executor
- theEventExecutor
which is used to notify the listeners of theFuture
returned byresolve(SocketAddress)
addressType
- the type of theSocketAddress
supported by this resolver
-
-
Method Details
-
executor
Returns theEventExecutor
which is used to notify the listeners of theFuture
returned byresolve(SocketAddress)
. -
isSupported
Description copied from interface:AddressResolver
Returnstrue
if and only if the specified address is supported by this resolved.- Specified by:
isSupported
in interfaceAddressResolver<T extends SocketAddress>
-
isResolved
Description copied from interface:AddressResolver
Returnstrue
if and only if the specified address has been resolved.- Specified by:
isResolved
in interfaceAddressResolver<T extends SocketAddress>
-
doIsResolved
Invoked byisResolved(SocketAddress)
to check if the specifiedaddress
has been resolved already. -
resolve
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 interfaceAddressResolver<T extends SocketAddress>
- Parameters:
address
- the address to resolve- Returns:
- the
SocketAddress
as the result of the resolution
-
resolve
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 interfaceAddressResolver<T extends SocketAddress>
- Parameters:
address
- the address to resolvepromise
- thePromise
which will be fulfilled when the name resolution is finished- Returns:
- the
SocketAddress
as the result of the resolution
-
resolveAll
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 interfaceAddressResolver<T extends SocketAddress>
- Parameters:
address
- the address to resolve- Returns:
- the list of the
SocketAddress
es as the result of the resolution
-
resolveAll
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 interfaceAddressResolver<T extends SocketAddress>
- Parameters:
address
- the address to resolvepromise
- thePromise
which will be fulfilled when the name resolution is finished- Returns:
- the list of the
SocketAddress
es as the result of the resolution
-
doResolve
Invoked byresolve(SocketAddress)
to perform the actual name resolution.- Throws:
Exception
-
doResolveAll
protected abstract void doResolveAll(T unresolvedAddress, Promise<List<T>> promise) throws Exception Invoked byresolveAll(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 interfaceAddressResolver<T extends SocketAddress>
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-