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 intdoWork(long nowMs) Perform periodic work for the resolver.default voidinit(MediaDriver.Context context) Deprecated.default voidinit(CountersReader countersReader, CounterProvider counterProvider) Do post construction initialisation of the name resolver.default StringLookup the name and return a string of the formname:portthat represents the endpoint or control param of the URI.default Stringname()Gets the name of the resolver, used for logging and debugging.Resolve a name and return the most up to dateInetAddressthat represents the name.
-
Method Details
-
resolve
Resolve a name and return the most up to dateInetAddressthat represents the name.- Parameters:
name- to resolve.uriParamName- that the resolution is for.isReResolution-trueif this is a re-resolution orfalseif 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:portthat represents the endpoint or control param of the URI.- Parameters:
name- to lookupuriParamName- that the lookup is for.isReLookup-trueif this is a re-lookup ortrueif initial lookup.- Returns:
- string in
name:portform.
-
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.