Interface LoadExceptionInfo<K,​V>

  • All Superinterfaces:
    CacheEntry<K,​V>, DataAware<K,​V>

    public interface LoadExceptionInfo<K,​V>
    extends CacheEntry<K,​V>
    Relevant information of a load attempt that generated an exception. This is used by the exception propagator and the resilience policy.

    Compatibility: This interface is not intended for implementation or extension by a client and may get additional methods in a new minor release.

    Rationale: The information does not contain the time of the original expiry of the cache value. This is intentional. There is no information field to record the time of expiry past the expiry itself. The expiry time information is reset as soon as the expiry time is reached. To produce no overhead, the information provided by this interface is captured only in case an exception happens.

    Since:
    2
    Author:
    Jens Wilke
    See Also:
    ExceptionPropagator, ResiliencePolicy
    • Method Detail

      • getValue

        default V getValue()
        Always throws exception based on exception propagator semantics. Inherited from CacheEntry
        Specified by:
        getValue in interface CacheEntry<K,​V>
      • generateExceptionToPropagate

        default RuntimeException generateExceptionToPropagate()
        Generate the exception to propagate with the exception propagator
      • getExceptionPropagator

        ExceptionPropagator<K,​V> getExceptionPropagator()
        The exception propagator in effect.
      • getRetryCount

        int getRetryCount()
        Number of retry attempts to load the value for the requested key. The value is starting 0 for the first load attempt that yields an exception. The counter is incremented for each consecutive loader exception. After a successful attempt to load the value is reset.
        Returns:
        counter starting at 0 for the first load attempt that yields an exception.
      • getSinceTime

        long getSinceTime()
        Start time of the load that generated the first exception.
        Returns:
        Time in millis since epoch or as defined by TimeReference.
      • getLoadTime

        long getLoadTime()
        Start time of the load operation that generated the recent exception.
        Returns:
        Time in millis since epoch or as defined by TimeReference.
      • getUntil

        long getUntil()
        Time in millis until the next retry attempt. This property is only set in the context of the ExceptionPropagator.
        Returns:
        Time in millis since epoch or as defined by TimeReference.