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.

@FunctionalInterface public interface LeaseStrategy
Strategy interface to control whether to retain or drop a Lease after a failure.
Since:
2.2
Author:
Mark Paluch
  • Method Details

    • shouldDrop

      boolean shouldDrop(Throwable error)
      Return true to drop the lease after error 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

      static LeaseStrategy dropOnError()
      Predefined strategy to drop leases on error.
      Returns:
      the drop on error strategy.
    • retainOnError

      static LeaseStrategy retainOnError()
      Predefined strategy to retain leases on error.
      Returns:
      the retain on error strategy.
    • retainOnIoError

      static LeaseStrategy retainOnIoError()
      Predefined strategy to retain leases on I/O errors.
      Returns:
      the retain on I/O error strategy.
      Since:
      2.3.3