Interface RaftNodeLifecycleAware


public interface RaftNodeLifecycleAware
Used by RaftNode to notify its components for its lifecycle-related changes, such as startup and termination. These components are RaftNodeExecutor, StateMachine, RaftModelFactory, Transport, RaftStore, and RaftNodeReportListener.

RaftNode does not manage the lifecycle of the components provided to it during construction. It only notifies the components that implement this interface.

RaftNode calls the lifecycle-aware components in random order.

See Also:
  • Method Details

    • onRaftNodeStart

      default void onRaftNodeStart()
      Called by RaftNode during startup.

      If an exception is thrown, RaftNode stops its start procedure and immediately terminates itself.

    • onRaftNodeTerminate

      default void onRaftNodeTerminate()
      Called by RaftNode during termination.

      The component will not receive any API call after this call.

      Exceptions thrown by implementations of this method are handled and logged by RaftNode.