@UnstableApi public abstract class AbstractAddressResolver<T extends SocketAddress> extends Object implements AddressResolver<T>
AddressResolver
implementation.Modifier | Constructor and Description |
---|---|
protected |
AbstractAddressResolver(io.netty.util.concurrent.EventExecutor executor) |
protected |
AbstractAddressResolver(io.netty.util.concurrent.EventExecutor executor,
Class<? extends T> addressType) |
Modifier and Type | Method and Description |
---|---|
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,
io.netty.util.concurrent.Promise<T> promise)
Invoked by
resolve(SocketAddress) to perform the actual name
resolution. |
protected abstract void |
doResolveAll(T unresolvedAddress,
io.netty.util.concurrent.Promise<List<T>> promise)
Invoked by
resolveAll(SocketAddress) to perform the actual name
resolution. |
protected io.netty.util.concurrent.EventExecutor |
executor()
Returns the
EventExecutor which is used to notify the listeners of the Future returned
by resolve(SocketAddress) . |
boolean |
isResolved(SocketAddress address)
Returns
true if and only if the specified address has been resolved. |
boolean |
isSupported(SocketAddress address)
Returns
true if and only if the specified address is supported by this resolved. |
io.netty.util.concurrent.Future<T> |
resolve(SocketAddress address)
Resolves the specified address.
|
io.netty.util.concurrent.Future<T> |
resolve(SocketAddress address,
io.netty.util.concurrent.Promise<T> promise)
Resolves the specified address.
|
io.netty.util.concurrent.Future<List<T>> |
resolveAll(SocketAddress address)
Resolves the specified address.
|
io.netty.util.concurrent.Future<List<T>> |
resolveAll(SocketAddress address,
io.netty.util.concurrent.Promise<List<T>> promise)
Resolves the specified address.
|
protected AbstractAddressResolver(io.netty.util.concurrent.EventExecutor executor)
executor
- the EventExecutor
which is used to notify the listeners of the Future
returned
by resolve(SocketAddress)
protected AbstractAddressResolver(io.netty.util.concurrent.EventExecutor executor, 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 io.netty.util.concurrent.EventExecutor executor()
EventExecutor
which is used to notify the listeners of the Future
returned
by resolve(SocketAddress)
.public boolean isSupported(SocketAddress address)
AddressResolver
true
if and only if the specified address is supported by this resolved.isSupported
in interface AddressResolver<T extends SocketAddress>
public final boolean isResolved(SocketAddress address)
AddressResolver
true
if and only if the specified address has been resolved.isResolved
in interface AddressResolver<T extends SocketAddress>
protected abstract boolean doIsResolved(T address)
isResolved(SocketAddress)
to check if the specified address
has been resolved
already.public final io.netty.util.concurrent.Future<T> resolve(SocketAddress address)
AddressResolver
resolve
in interface AddressResolver<T extends SocketAddress>
address
- the address to resolveSocketAddress
as the result of the resolutionpublic final io.netty.util.concurrent.Future<T> resolve(SocketAddress address, io.netty.util.concurrent.Promise<T> promise)
AddressResolver
resolve
in interface AddressResolver<T extends 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 io.netty.util.concurrent.Future<List<T>> resolveAll(SocketAddress address)
AddressResolver
resolveAll
in interface AddressResolver<T extends SocketAddress>
address
- the address to resolveSocketAddress
es as the result of the resolutionpublic final io.netty.util.concurrent.Future<List<T>> resolveAll(SocketAddress address, io.netty.util.concurrent.Promise<List<T>> promise)
AddressResolver
resolveAll
in interface AddressResolver<T extends SocketAddress>
address
- the address to resolvepromise
- the Promise
which will be fulfilled when the name resolution is finishedSocketAddress
es as the result of the resolutionprotected abstract void doResolve(T unresolvedAddress, io.netty.util.concurrent.Promise<T> promise) throws Exception
resolve(SocketAddress)
to perform the actual name
resolution.Exception
protected abstract void doResolveAll(T unresolvedAddress, io.netty.util.concurrent.Promise<List<T>> promise) throws Exception
resolveAll(SocketAddress)
to perform the actual name
resolution.Exception
public void close()
AddressResolver
close
in interface AddressResolver<T extends SocketAddress>
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2008–2019 The Netty Project. All rights reserved.