Skip to content

Commit 36fae1d

Browse files
committed
Improve docs around policy listeners
Per issue #248
1 parent 46271f5 commit 36fae1d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/net/jodah/failsafe/PolicyListeners.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,18 @@ public class PolicyListeners<S, R> {
3333
EventListener successListener;
3434

3535
/**
36-
* Registers the {@code listener} to be called when an execution fails for a {@link Policy}.
36+
* Registers the {@code listener} to be called when a {@link Policy} fails to handle an execution. This means that not
37+
* only was the supplied execution considered a failure by the policy, but that the policy was unable to produce a
38+
* successful result.
3739
*/
3840
public S onFailure(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener) {
3941
failureListener = EventListener.of(Assert.notNull(listener, "listener"));
4042
return (S) this;
4143
}
4244

4345
/**
44-
* Registers the {@code listener} to be called when an execution is successful for a {@link Policy}.
46+
* Registers the {@code listener} to be called when a {@link Policy} succeeds in handling an execution. This means
47+
* that the supplied execution either succeeded, or if it failed, the policy was able to produce a successful result.
4548
*/
4649
public S onSuccess(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener) {
4750
successListener = EventListener.of(Assert.notNull(listener, "listener"));

0 commit comments

Comments
 (0)