Interface DiscoveryService


public interface DiscoveryService
The DiscoveryService interface defines the basic entry point into the Discovery SPI implementation. If not overridden explicitly the Hazelcast internal DefaultDiscoveryService implementation is used. A DiscoveryService somehow finds available DiscoveryStrategys inside the classpath and manages their activation or deactivation status.

This interface is used by system integrators, integrating Hazelcast into their own frameworks or environments, are free to extend or exchange the default implementation based on their needs and requirements.

Only enabled providers are expected to discover nodes but, depending on the DiscoveryService implementation, multiple DiscoveryStrategys might be enabled at the same time (e.g. TCP-IP Joiner with well known addresses and Cloud discovery).

Since:
3.6
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The start method is called on system startup to implement simple lifecycle management.
    Returns a discovered and filtered, if a NodeFilter is set up, set of discovered nodes to connect to.
    void
    The start method is called on system startup to implement simple lifecycle management.
  • Method Details

    • start

      void start()
      The start method is called on system startup to implement simple lifecycle management. This method is expected to call DiscoveryStrategy.start() on all discovered and start up strategies.
    • discoverNodes

      Iterable<DiscoveryNode> discoverNodes()
      Returns a discovered and filtered, if a NodeFilter is set up, set of discovered nodes to connect to.
      Returns:
      a set of discovered and filtered nodes
    • destroy

      void destroy()
      The start method is called on system startup to implement simple lifecycle management. This method is expected to call DiscoveryStrategy.destroy() on all discovered and destroy strategies before the service itself will be destroyed.