S
- self typeR
- result typepublic class PolicyListeners<S,R> extends Object
Constructor and Description |
---|
PolicyListeners() |
Modifier and Type | Method and Description |
---|---|
S |
onFailure(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when a Policy fails to handle an execution. |
S |
onSuccess(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
Registers the
listener to be called when a Policy succeeds in handling an execution. |
public S onFailure(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
listener
to be called when a Policy
fails to handle an execution. This means that not
only was the supplied execution considered a failure by the policy, but that the policy was unable to produce a
successful result.public S onSuccess(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener)
listener
to be called when a Policy
succeeds in handling an execution. This means
that the supplied execution either succeeded, or if it failed, the policy was able to produce a successful result.Copyright © 2020. All rights reserved.