public abstract class SimpleNameResolver<T extends SocketAddress> extends Object implements NameResolver<T>
NameResolver
implementation.Modifier | Constructor and Description |
---|---|
protected |
SimpleNameResolver(EventExecutor executor) |
protected |
SimpleNameResolver(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,
Promise<T> promise)
Invoked by
resolve(SocketAddress) and resolve(String, int) 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(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. |
Future<T> |
resolve(SocketAddress address)
Resolves the specified address.
|
Future<T> |
resolve(SocketAddress address,
Promise<T> promise)
Resolves the specified address.
|
Future<T> |
resolve(String inetHost,
int inetPort)
Resolves the specified name into a
SocketAddress . |
Future<T> |
resolve(String inetHost,
int inetPort,
Promise<T> promise)
Resolves the specified name into a
SocketAddress . |
protected SimpleNameResolver(EventExecutor executor)
executor
- the EventExecutor
which is used to notify the listeners of the Future
returned
by resolve(SocketAddress)
protected SimpleNameResolver(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 EventExecutor executor()
EventExecutor
which is used to notify the listeners of the Future
returned
by resolve(SocketAddress)
.public boolean isSupported(SocketAddress address)
NameResolver
true
if and only if the specified address is supported by this resolved.isSupported
in interface NameResolver<T extends SocketAddress>
public final boolean isResolved(SocketAddress address)
NameResolver
true
if and only if the specified address has been resolved.isResolved
in interface NameResolver<T extends SocketAddress>
protected abstract boolean doIsResolved(T address)
isResolved(SocketAddress)
to check if the specified address
has been resolved
already.public final Future<T> resolve(String inetHost, int inetPort)
NameResolver
SocketAddress
.resolve
in interface NameResolver<T extends SocketAddress>
inetHost
- the name to resolveinetPort
- the port numberSocketAddress
as the result of the resolutionpublic Future<T> resolve(String inetHost, int inetPort, Promise<T> promise)
NameResolver
SocketAddress
.resolve
in interface NameResolver<T extends SocketAddress>
inetHost
- the name to resolveinetPort
- the port numberpromise
- the Promise
which will be fulfilled when the name resolution is finishedSocketAddress
as the result of the resolutionpublic final Future<T> resolve(SocketAddress address)
NameResolver
resolve
in interface NameResolver<T extends SocketAddress>
address
- the address to resolveSocketAddress
as the result of the resolutionpublic final Future<T> resolve(SocketAddress address, Promise<T> promise)
NameResolver
resolve
in interface NameResolver<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 resolutionprotected abstract void doResolve(T unresolvedAddress, Promise<T> promise) throws Exception
resolve(SocketAddress)
and resolve(String, int)
to perform the actual name
resolution.Exception
public void close()
NameResolver
close
in interface NameResolver<T extends SocketAddress>
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2008–2015 The Netty Project. All rights reserved.