Module io.netty5.resolver
Package io.netty5.resolver
Class AddressResolverGroup<T extends SocketAddress>
- java.lang.Object
-
- io.netty5.resolver.AddressResolverGroup<T>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
DefaultAddressResolverGroup
,DnsAddressResolverGroup
,NoopAddressResolverGroup
public abstract class AddressResolverGroup<T extends SocketAddress> extends Object implements Closeable
Creates and managesNameResolver
s so that eachEventExecutor
has its own resolver instance.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AddressResolverGroup()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
Closes allNameResolver
s created by this group.AddressResolver<T>
getResolver(EventExecutor executor)
Returns theAddressResolver
associated with the specifiedEventExecutor
.protected abstract AddressResolver<T>
newResolver(EventExecutor executor)
Invoked bygetResolver(EventExecutor)
to create a newAddressResolver
.
-
-
-
Method Detail
-
getResolver
public AddressResolver<T> getResolver(EventExecutor executor)
Returns theAddressResolver
associated with the specifiedEventExecutor
. If there's no associated resolver found, this method creates and returns a new resolver instance created bynewResolver(EventExecutor)
so that the new resolver is reused on another#getResolver(EventExecutor)
call with the sameEventExecutor
.
-
newResolver
protected abstract AddressResolver<T> newResolver(EventExecutor executor) throws Exception
Invoked bygetResolver(EventExecutor)
to create a newAddressResolver
.- Throws:
Exception
-
close
public void close()
Closes allNameResolver
s created by this group.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-