Class EmbeddedLeaderService


  • public class EmbeddedLeaderService
    extends Object
    A simple leader election service, which selects a leader among contenders and notifies listeners.

    An election service for contenders can be created via #createLeaderElectionService(), a listener service for leader observers can be created via createLeaderRetrievalService().

    • Constructor Detail

      • EmbeddedLeaderService

        public EmbeddedLeaderService​(Executor notificationsDispatcher)
    • Method Detail

      • shutdown

        public void shutdown()
        Shuts down this leader election service.

        This method does not perform a clean revocation of the leader status and no notification to any leader listeners. It simply notifies all contenders and listeners that the service is no longer available.

      • createLeaderElectionService

        public LeaderElection createLeaderElectionService​(String componentId)