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 Details

    • notifyLeaderAddress

      void notifyLeaderAddress(@Nullable String leaderAddress, @Nullable UUID leaderSessionID)
      This method is called by the LeaderRetrievalService when 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 leader
      leaderSessionID - The new leader session ID
    • handleError

      void handleError(Exception exception)
      This method is called by the LeaderRetrievalService in case of an exception. This assures that the LeaderRetrievalListener is aware of any problems occurring in the LeaderRetrievalService thread.
      Parameters:
      exception -