public abstract class AbstractAddressResolver<T extends java.net.SocketAddress> extends java.lang.Object implements AddressResolver<T>
AddressResolver implementation.| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractAddressResolver(EventExecutor executor) |
protected |
AbstractAddressResolver(EventExecutor executor,
java.lang.Class<? extends T> addressType) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
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<java.util.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). |
boolean |
isResolved(java.net.SocketAddress address)
Returns
true if and only if the specified address has been resolved. |
boolean |
isSupported(java.net.SocketAddress address)
Returns
true if and only if the specified address is supported by this resolved. |
Future<T> |
resolve(java.net.SocketAddress address)
Resolves the specified address.
|
Future<T> |
resolve(java.net.SocketAddress address,
Promise<T> promise)
Resolves the specified address.
|
Future<java.util.List<T>> |
resolveAll(java.net.SocketAddress address)
Resolves the specified address.
|
Future<java.util.List<T>> |
resolveAll(java.net.SocketAddress address,
Promise<java.util.List<T>> promise)
Resolves the specified address.
|
protected AbstractAddressResolver(EventExecutor executor)
executor - the EventExecutor which is used to notify the listeners of the Future returned
by resolve(SocketAddress)protected AbstractAddressResolver(EventExecutor executor, java.lang.Class<? extends T> addressType)
executor - the EventExecutor which is used to notify the listeners of the Future returned
by resolve(SocketAddress)addressType - the type of the SocketAddress supported by this resolverprotected EventExecutor executor()
EventExecutor which is used to notify the listeners of the Future returned
by resolve(SocketAddress).public boolean isSupported(java.net.SocketAddress address)
AddressResolvertrue if and only if the specified address is supported by this resolved.isSupported 在接口中 AddressResolver<T extends java.net.SocketAddress>public final boolean isResolved(java.net.SocketAddress address)
AddressResolvertrue if and only if the specified address has been resolved.isResolved 在接口中 AddressResolver<T extends java.net.SocketAddress>protected abstract boolean doIsResolved(T address)
isResolved(SocketAddress) to check if the specified address has been resolved
already.public final Future<T> resolve(java.net.SocketAddress address)
AddressResolverresolve 在接口中 AddressResolver<T extends java.net.SocketAddress>address - the address to resolveSocketAddress as the result of the resolutionpublic final Future<T> resolve(java.net.SocketAddress address, Promise<T> promise)
AddressResolverresolve 在接口中 AddressResolver<T extends java.net.SocketAddress>address - the address to resolvepromise - the Promise which will be fulfilled when the name resolution is finishedSocketAddress as the result of the resolutionpublic final Future<java.util.List<T>> resolveAll(java.net.SocketAddress address)
AddressResolverresolveAll 在接口中 AddressResolver<T extends java.net.SocketAddress>address - the address to resolveSocketAddresses as the result of the resolutionpublic final Future<java.util.List<T>> resolveAll(java.net.SocketAddress address, Promise<java.util.List<T>> promise)
AddressResolverresolveAll 在接口中 AddressResolver<T extends java.net.SocketAddress>address - the address to resolvepromise - the Promise which will be fulfilled when the name resolution is finishedSocketAddresses as the result of the resolutionprotected abstract void doResolve(T unresolvedAddress, Promise<T> promise) throws java.lang.Exception
resolve(SocketAddress) to perform the actual name
resolution.java.lang.Exceptionprotected abstract void doResolveAll(T unresolvedAddress, Promise<java.util.List<T>> promise) throws java.lang.Exception
resolveAll(SocketAddress) to perform the actual name
resolution.java.lang.Exceptionpublic void close()
AddressResolverclose 在接口中 AddressResolver<T extends java.net.SocketAddress>close 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseable