Interface ExpirationListener

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 ExpirationListener
A listener notified after each expiration task run.

Implementations can use this callback for logging, alerting, or custom metrics. The built-in Micrometer metrics listener is registered automatically when metrics are enabled via ExpirationTaskBuilder.withMetrics(boolean).

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onTaskRun(String realmId, Outcome outcome, int removed, Duration duration)
    Called after an expiration task run completes for a given scope (global or per-realm).
  • Method Details

    • onTaskRun

      void onTaskRun(String realmId, Outcome outcome, int removed, Duration duration)
      Called after an expiration task run completes for a given scope (global or per-realm).
      Parameters:
      realmId - the realm that was cleaned up, or null for non-realm-aware expiration tasks.
      outcome - the outcome of the task run.
      removed - the total number of expired entries removed across all batches.
      duration - the wall-clock duration of the task run.