public abstract class SimpleNameResolver<T> extends Object implements NameResolver<T>
NameResolver
implementation.Modifier | Constructor and Description |
---|---|
protected |
SimpleNameResolver(EventExecutor executor) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all the resources allocated and used by this resolver.
|
protected abstract void |
doResolve(String inetHost,
Promise<T> promise)
Invoked by
resolve(String) to perform the actual name resolution. |
protected abstract void |
doResolveAll(String inetHost,
Promise<List<T>> promise)
Invoked by
resolveAll(String) 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(String) . |
Future<T> |
resolve(String inetHost)
Resolves the specified name into an address.
|
Future<T> |
resolve(String inetHost,
Promise<T> promise)
Resolves the specified name into an address.
|
Future<List<T>> |
resolveAll(String inetHost)
Resolves the specified host name and port into a list of address.
|
Future<List<T>> |
resolveAll(String inetHost,
Promise<List<T>> promise)
Resolves the specified host name and port into a list of address.
|
protected SimpleNameResolver(EventExecutor executor)
executor
- the EventExecutor
which is used to notify the listeners of the Future
returned
by resolve(String)
protected EventExecutor executor()
EventExecutor
which is used to notify the listeners of the Future
returned
by resolve(String)
.public final Future<T> resolve(String inetHost)
NameResolver
resolve
in interface NameResolver<T>
inetHost
- the name to resolvepublic Future<T> resolve(String inetHost, Promise<T> promise)
NameResolver
resolve
in interface NameResolver<T>
inetHost
- the name to resolvepromise
- the Promise
which will be fulfilled when the name resolution is finishedpublic final Future<List<T>> resolveAll(String inetHost)
NameResolver
resolveAll
in interface NameResolver<T>
inetHost
- the name to resolvepublic Future<List<T>> resolveAll(String inetHost, Promise<List<T>> promise)
NameResolver
resolveAll
in interface NameResolver<T>
inetHost
- the name to resolvepromise
- the Promise
which will be fulfilled when the name resolution is finishedprotected abstract void doResolve(String inetHost, Promise<T> promise) throws Exception
resolve(String)
to perform the actual name resolution.Exception
protected abstract void doResolveAll(String inetHost, Promise<List<T>> promise) throws Exception
resolveAll(String)
to perform the actual name resolution.Exception
public void close()
NameResolver
close
in interface NameResolver<T>
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2008–2024 The Netty Project. All rights reserved.