Package io.aeron.driver
Interface NameResolver
- All Known Implementing Classes:
DefaultNameResolver
public interface NameResolver
Interface to allow resolving a name to an
InetAddress
.-
Method Summary
Modifier and TypeMethodDescriptiondefault int
doWork
(long nowMs) Perform periodic work for the resolver.default void
init
(MediaDriver.Context context) Deprecated.default void
init
(CountersReader countersReader, CounterProvider counterProvider) Do post construction initialisation of the name resolver.default String
Lookup the name and return a string of the formname:port
that represents the endpoint or control param of the URI.default String
name()
Gets the name of the resolver, used for logging and debugging.Resolve a name and return the most up to dateInetAddress
that represents the name.
-
Method Details
-
resolve
Resolve a name and return the most up to dateInetAddress
that represents the name.- Parameters:
name
- to resolve.uriParamName
- that the resolution is for.isReResolution
-true
if this is a re-resolution orfalse
if initial resolution.- Returns:
- address for the name that most recently represents the name or null if not resolvable currently.
- See Also:
-
lookup
Lookup the name and return a string of the formname:port
that represents the endpoint or control param of the URI.- Parameters:
name
- to lookupuriParamName
- that the lookup is for.isReLookup
-true
if this is a re-lookup ortrue
if initial lookup.- Returns:
- string in
name:port
form.
-
init
Deprecated.Useinit(CountersReader, CounterProvider)
instead.Do post construction initialisation of the name resolver. Happens during the conductor start lifecycle. Can be used for actions like adding counters.- Parameters:
context
- for the media driver that the name resolver is running in.- See Also:
-
init
Do post construction initialisation of the name resolver.- Parameters:
countersReader
- for finding existing counters.counterProvider
- for adding counters.
-
doWork
default int doWork(long nowMs) Perform periodic work for the resolver.- Parameters:
nowMs
- current epoch clock time in milliseconds- Returns:
- work count
-
name
Gets the name of the resolver, used for logging and debugging.- Returns:
- name of the resolver, defaults to the qualified class name.
-
init(CountersReader, CounterProvider)
instead.