Interface LeaderRetrievalListener
- All Known Implementing Classes:
ConnectionUtils.LeaderConnectingAddressListener,LeaderGatewayRetriever,LeaderRetrievalUtils.LeaderInformationListener,LeaderRetriever,RpcGatewayRetriever
public interface LeaderRetrievalListener
Classes which want to be notified about a changing leader by the
LeaderRetrievalService
have to implement this interface.-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(Exception exception) This method is called by theLeaderRetrievalServicein case of an exception.voidnotifyLeaderAddress(String leaderAddress, UUID leaderSessionID) This method is called by theLeaderRetrievalServicewhen a new leader is elected.
-
Method Details
-
notifyLeaderAddress
This method is called by theLeaderRetrievalServicewhen a new leader is elected.If both arguments are null then it signals that leadership was revoked without a new leader having been elected.
- Parameters:
leaderAddress- The address of the new leaderleaderSessionID- The new leader session ID
-
handleError
This method is called by theLeaderRetrievalServicein case of an exception. This assures that theLeaderRetrievalListeneris aware of any problems occurring in theLeaderRetrievalServicethread.- Parameters:
exception-
-