Interface LeaderRetrievalService
- All Known Implementing Classes:
DefaultLeaderRetrievalService,StandaloneLeaderRetrievalService
public interface LeaderRetrievalService
This interface has to be implemented by a service which retrieves the current leader and notifies
a listener about it.
Prior to using this service it has to be started by calling the start method. The start method
also takes the LeaderRetrievalListener as an argument. The service can only be started
once.
The service should be stopped by calling the stop method.
-
Method Summary
Modifier and TypeMethodDescriptionvoidstart(LeaderRetrievalListener listener) Starts the leader retrieval service with the given listener to listen for new leaders.voidstop()Stops the leader retrieval service.
-
Method Details
-
start
Starts the leader retrieval service with the given listener to listen for new leaders. This method can only be called once.- Parameters:
listener- The leader retrieval listener which will be notified about new leaders.- Throws:
Exception
-
stop
Stops the leader retrieval service.- Throws:
Exception
-