Top Description Fields Constructors Methods
io.netty5.resolver

public abstract Class AbstractAddressResolver<T extends java.net.SocketAddress>

extends Object
implements AddressResolver<T extends SocketAddress>
Class Inheritance
All Implemented Interfaces
io.netty5.resolver.AddressResolver, java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
io.netty5.resolver.InetSocketAddressResolver, io.netty5.resolver.NoopAddressResolver
Imports
io.netty5.util.concurrent.EventExecutor, .Future, .Promise, io.netty5.util.internal.TypeParameterMatcher, java.net.SocketAddress, java.nio.channels.UnsupportedAddressTypeException, java.util.Collections, .List

A skeletal AddressResolver implementation.

Field Summary

Modifier and TypeField and Description
private final EventExecutor
private final TypeParameterMatcher

Constructor Summary

AccessConstructor and Description
protected
AbstractAddressResolver(EventExecutor
the EventExecutor which is used to notify the listeners of the Future returned by resolve(SocketAddress)
executor
)

protected
AbstractAddressResolver(EventExecutor
the EventExecutor which is used to notify the listeners of the Future returned by resolve(SocketAddress)
executor
,
Class<? extends T>
the type of the SocketAddress supported by this resolver
addressType
)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements io.netty5.resolver.AddressResolver.close.

Closes all the resources allocated and used by this resolver.
protected abstract boolean
doIsResolved(T address)

Invoked by isResolved(SocketAddress) to check if the specified address has been resolved already.

protected abstract void
doResolve(T unresolvedAddress, Promise<T> promise)

Invoked by resolve(SocketAddress) to perform the actual name resolution.

protected abstract void
doResolveAll(T unresolvedAddress, Promise<List<T>> promise)

Invoked by resolveAll(SocketAddress) to perform the actual name resolution.

protected EventExecutor
executor()

Returns the EventExecutor which is used to notify the listeners of the Future returned by resolve(SocketAddress).

public final boolean
isResolved(SocketAddress address)

Implements io.netty5.resolver.AddressResolver.isResolved.

Returns true if and only if the specified address has been resolved.
public boolean
isSupported(SocketAddress address)

Implements io.netty5.resolver.AddressResolver.isSupported.

Returns true if and only if the specified address is supported by this resolved.
public final Future<T>
resolve(SocketAddress
the address to resolve
address
)

Implements io.netty5.resolver.AddressResolver.resolve.

Resolves the specified address.
public final Future<T>
resolve(SocketAddress
the address to resolve
address
,
Promise<T>
the Promise which will be fulfilled when the name resolution is finished
promise
)

Implements io.netty5.resolver.AddressResolver.resolve.

Resolves the specified address.
public final Future<List<T>>
resolveAll(SocketAddress
the address to resolve
address
)

Implements io.netty5.resolver.AddressResolver.resolveAll.

Resolves the specified address.
public final Future<List<T>>
resolveAll(SocketAddress
the address to resolve
address
,
Promise<List<T>>
the Promise which will be fulfilled when the name resolution is finished
promise
)

Implements io.netty5.resolver.AddressResolver.resolveAll.

Resolves the specified address.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

executorback to summary
private final EventExecutor executor
matcherback to summary
private final TypeParameterMatcher matcher

Constructor Detail

AbstractAddressResolverback to summary
protected AbstractAddressResolver(EventExecutor executor)
Parameters
executor:EventExecutor

the EventExecutor which is used to notify the listeners of the Future returned by resolve(SocketAddress)

AbstractAddressResolverback to summary
protected AbstractAddressResolver(EventExecutor executor, Class<? extends T> addressType)
Parameters
executor:EventExecutor

the EventExecutor which is used to notify the listeners of the Future returned by resolve(SocketAddress)

addressType:Class<? extends T>

the type of the SocketAddress supported by this resolver

Method Detail

closeback to summary
public void close()

Implements io.netty5.resolver.AddressResolver.close.

Doc from io.netty5.resolver.AddressResolver.close.

Closes all the resources allocated and used by this resolver.

Annotations
@Override
doIsResolvedback to summary
protected abstract boolean doIsResolved(T address)

Invoked by isResolved(SocketAddress) to check if the specified address has been resolved already.

doResolveback to summary
protected abstract void doResolve(T unresolvedAddress, Promise<T> promise) throws Exception

Invoked by resolve(SocketAddress) to perform the actual name resolution.

doResolveAllback to summary
protected abstract void doResolveAll(T unresolvedAddress, Promise<List<T>> promise) throws Exception

Invoked by resolveAll(SocketAddress) to perform the actual name resolution.

executorback to summary
protected EventExecutor executor()

Returns the EventExecutor which is used to notify the listeners of the Future returned by resolve(SocketAddress).

isResolvedback to summary
public final boolean isResolved(SocketAddress address)

Implements io.netty5.resolver.AddressResolver.isResolved.

Doc from io.netty5.resolver.AddressResolver.isResolved.

Returns true if and only if the specified address has been resolved.

Annotations
@Override
isSupportedback to summary
public boolean isSupported(SocketAddress address)

Implements io.netty5.resolver.AddressResolver.isSupported.

Doc from io.netty5.resolver.AddressResolver.isSupported.

Returns true if and only if the specified address is supported by this resolved.

Annotations
@Override
resolveback to summary
public final Future<T> resolve(SocketAddress address)

Implements io.netty5.resolver.AddressResolver.resolve.

Doc from io.netty5.resolver.AddressResolver.resolve.

Resolves the specified address. If the specified address is resolved already, this method does nothing but returning the original address.

Parameters
address:SocketAddress

the address to resolve

Returns:Future<T>

the SocketAddress as the result of the resolution

Annotations
@Override
resolveback to summary
public final Future<T> resolve(SocketAddress address, Promise<T> promise)

Implements io.netty5.resolver.AddressResolver.resolve.

Doc from io.netty5.resolver.AddressResolver.resolve.

Resolves the specified address. If the specified address is resolved already, this method does nothing but returning the original address.

Parameters
address:SocketAddress

the address to resolve

promise:Promise<T>

the Promise which will be fulfilled when the name resolution is finished

Returns:Future<T>

the SocketAddress as the result of the resolution

Annotations
@Override
resolveAllback to summary
public final Future<List<T>> resolveAll(SocketAddress address)

Implements io.netty5.resolver.AddressResolver.resolveAll.

Doc from io.netty5.resolver.AddressResolver.resolveAll.

Resolves the specified address. If the specified address is resolved already, this method does nothing but returning the original address.

Parameters
address:SocketAddress

the address to resolve

Returns:Future<List<T>>

the list of the SocketAddresses as the result of the resolution

Annotations
@Override
resolveAllback to summary
public final Future<List<T>> resolveAll(SocketAddress address, Promise<List<T>> promise)

Implements io.netty5.resolver.AddressResolver.resolveAll.

Doc from io.netty5.resolver.AddressResolver.resolveAll.

Resolves the specified address. If the specified address is resolved already, this method does nothing but returning the original address.

Parameters
address:SocketAddress

the address to resolve

promise:Promise<List<T>>

the Promise which will be fulfilled when the name resolution is finished

Returns:Future<List<T>>

the list of the SocketAddresses as the result of the resolution

Annotations
@Override