Interface LeaseStrategy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy interface to control whether to retain or drop a
Lease
after a failure.- Since:
- 2.2
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionstatic LeaseStrategy
Predefined strategy to drop leases on error.static LeaseStrategy
Predefined strategy to retain leases on error.static LeaseStrategy
Predefined strategy to retain leases on I/O errors.boolean
shouldDrop
(Throwable error) Return true to drop the lease aftererror
happened.
-
Method Details
-
shouldDrop
Return true to drop the lease aftererror
happened. false to retain the lease.- Parameters:
error
- the error that occurred.- Returns:
- true to drop the lease after
error
happened. false to retain the lease.
-
dropOnError
Predefined strategy to drop leases on error.- Returns:
- the drop on error strategy.
-
retainOnError
Predefined strategy to retain leases on error.- Returns:
- the retain on error strategy.
-
retainOnIoError
Predefined strategy to retain leases on I/O errors.- Returns:
- the retain on I/O error strategy.
- Since:
- 2.3.3
-