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
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract MoreObjects.ToStringHelper
Enrich aMoreObjects.ToStringHelper
with class-specific attributes.abstract void
Invoke the callback.final String
toString()
-
Constructor Details
-
RaftCallback
public RaftCallback()
-
-
Method Details
-
invoke
Invoke the callback.- Parameters:
failure
- failure cause,null
if successfulsuccess
- successful result, only valid iffailure == null
-
addToStringAttributes
@NonNullByDefault protected abstract MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper helper) Enrich aMoreObjects.ToStringHelper
with class-specific attributes.- Parameters:
helper
- the helper- Returns:
- the helper
-
toString
-