Interface InstanceDiscoveryService
- All Known Implementing Classes:
JndiSrvInstanceDiscoveryService
,SpotifySrvInstanceDiscoveryService
,StaticInstanceDiscoveryService
public interface InstanceDiscoveryService
Tracks and discovers remote instance of instances that have announced themselves on the network.
-
Method Summary
Modifier and TypeMethodDescriptionGets the known remote hosts.default void
start()
default void
stop()
subscribeToDiscovery
(Consumer<InstanceHostInfo> instanceHostInfoConsumer) Subscribes to an event that fires when a new host joins the network.subscribeToUndiscovery
(Consumer<InstanceHostInfo> instanceHostInfoConsumer) Subscribes to an event that fires when a host leaves the network.
-
Method Details
-
start
default void start() -
stop
default void stop() -
getKnownHosts
Collection<InstanceHostInfo> getKnownHosts()Gets the known remote hosts. -
subscribeToDiscovery
Subscribes to an event that fires when a new host joins the network.- Parameters:
instanceHostInfoConsumer
- theInstanceHostInfo
- Returns:
- the
Subscription
-
subscribeToUndiscovery
Subscribes to an event that fires when a host leaves the network.- Parameters:
instanceHostInfoConsumer
- theInstanceHostInfo
- Returns:
- the
Subscription
-