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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
start(LeaderRetrievalListener listener)
Starts the leader retrieval service with the given listener to listen for new leaders.void
stop()
Stops the leader retrieval service.
-
-
-
Method Detail
-
start
void start(LeaderRetrievalListener listener) throws Exception
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
-
-