Class RaftCallback<T>

java.lang.Object
org.opendaylight.controller.cluster.raft.spi.RaftCallback<T>
Type Parameters:
T - type of successful result
Direct Known Subclasses:
DecoratingRaftCallback

public abstract class RaftCallback<T> extends Object
A simple callback interface. Guaranteed to be invoked in RaftActor confinement.
API Note:
We choose an abstract class over a functional interface so we can force a toString() implementation friendly to logging -- quite the opposite of what lambdas would do.
  • Constructor Details

    • RaftCallback

      public RaftCallback()
  • Method Details

    • invoke

      public abstract void invoke(@Nullable Exception failure, T success)
      Invoke the callback.
      Parameters:
      failure - failure cause, null if successful
      success - successful result, only valid if failure == null
    • addToStringAttributes

      @NonNullByDefault protected abstract MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper helper)
      Enrich a MoreObjects.ToStringHelper with class-specific attributes.
      Parameters:
      helper - the helper
      Returns:
      the helper
    • toString

      public final String toString()
      Overrides:
      toString in class Object