Top Description Fields Constructors Methods
io.netty.resolver

public abstract Class AddressResolverGroup<T extends SocketAddress>

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
io.netty.resolver.DefaultAddressResolverGroup, io.netty.resolver.NoopAddressResolverGroup
Imports
io.netty.util.concurrent.EventExecutor, .Future, .FutureListener, .GenericFutureListener, io.netty.util.internal.ObjectUtil, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.io.Closeable, java.net.SocketAddress, java.util.IdentityHashMap, .Map, java.util.concurrent.ConcurrentMap

Creates and manages NameResolvers so that each EventExecutor has its own resolver instance.

Field Summary

Modifier and TypeField and Description
private final Map<EventExecutor, GenericFutureListener<Future<Object>>>
private static final InternalLogger
private final Map<EventExecutor, AddressResolver<T>>
resolvers

Note that we do not use a ConcurrentMap here because it is usually expensive to instantiate a resolver.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes all NameResolvers created by this group.
public AddressResolver<T>
getResolver(final EventExecutor executor)

Returns the AddressResolver associated with the specified EventExecutor.

protected abstract AddressResolver<T>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

executorTerminationListenersback to summary
private final Map<EventExecutor, GenericFutureListener<Future<Object>>> executorTerminationListeners
loggerback to summary
private static final InternalLogger logger
resolversback to summary
private final Map<EventExecutor, AddressResolver<T>> resolvers

Note that we do not use a ConcurrentMap here because it is usually expensive to instantiate a resolver.

Constructor Detail

AddressResolverGroupback to summary
protected AddressResolverGroup()

Method Detail

closeback to summary
public void close()

Implements java.io.Closeable.close.

Closes all NameResolvers created by this group.

Annotations
@Override
@SuppressWarnings:unchecked, SuspiciousToArrayCall
getResolverback to summary
public AddressResolver<T> getResolver(final EventExecutor executor)

Returns the AddressResolver associated with the specified EventExecutor. If there's no associated resolver found, this method creates and returns a new resolver instance created by newResolver(EventExecutor) so that the new resolver is reused on another #getResolver(EventExecutor) call with the same EventExecutor.

newResolverback to summary
protected abstract AddressResolver<T> newResolver(EventExecutor executor) throws Exception

Invoked by getResolver(EventExecutor) to create a new AddressResolver.