@UnstableApi public abstract class SimpleNameResolver<T> extends Object implements NameResolver<T>
NameResolver
implementation.Modifier | Constructor and Description |
---|---|
protected |
SimpleNameResolver(io.netty.util.concurrent.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,
io.netty.util.concurrent.Promise<T> promise)
Invoked by
resolve(String) to perform the actual name resolution. |
protected abstract void |
doResolveAll(String inetHost,
io.netty.util.concurrent.Promise<List<T>> promise)
Invoked by
resolveAll(String) 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(String) . |
io.netty.util.concurrent.Future<T> |
resolve(String inetHost)
Resolves the specified name into an address.
|
io.netty.util.concurrent.Future<T> |
resolve(String inetHost,
io.netty.util.concurrent.Promise<T> promise)
Resolves the specified name into an address.
|
io.netty.util.concurrent.Future<List<T>> |
resolveAll(String inetHost)
Resolves the specified host name and port into a list of address.
|
io.netty.util.concurrent.Future<List<T>> |
resolveAll(String inetHost,
io.netty.util.concurrent.Promise<List<T>> promise)
Resolves the specified host name and port into a list of address.
|
protected SimpleNameResolver(io.netty.util.concurrent.EventExecutor executor)
executor
- the EventExecutor
which is used to notify the listeners of the Future
returned
by resolve(String)
protected io.netty.util.concurrent.EventExecutor executor()
EventExecutor
which is used to notify the listeners of the Future
returned
by resolve(String)
.public final io.netty.util.concurrent.Future<T> resolve(String inetHost)
NameResolver
resolve
in interface NameResolver<T>
inetHost
- the name to resolvepublic io.netty.util.concurrent.Future<T> resolve(String inetHost, io.netty.util.concurrent.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 io.netty.util.concurrent.Future<List<T>> resolveAll(String inetHost)
NameResolver
resolveAll
in interface NameResolver<T>
inetHost
- the name to resolvepublic io.netty.util.concurrent.Future<List<T>> resolveAll(String inetHost, io.netty.util.concurrent.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, io.netty.util.concurrent.Promise<T> promise) throws Exception
resolve(String)
to perform the actual name resolution.Exception
protected abstract void doResolveAll(String inetHost, io.netty.util.concurrent.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–2019 The Netty Project. All rights reserved.