Interface ExpirationManager<K,V>


@ThreadSafe public interface ExpirationManager<K,V>
Central component that deals with expiration of cache entries.

Typically, processExpiration() is called periodically by the expiration thread (which can be configured using ExpirationConfigurationBuilder.wakeUpInterval(long) and GlobalConfigurationBuilder.expirationThreadPool()).

If the expiration thread is disabled - by setting ExpirationConfigurationBuilder.wakeUpInterval(long) to 0 - then this method could be called directly, perhaps by any other maintenance thread that runs periodically in the application.

Since:
7.2
Author:
William Burns
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleInMemoryExpiration(org.infinispan.container.entries.InternalCacheEntry<K,V> entry, long currentTime)
    Deprecated.
    since 9.3 this method is not intended for external use
    void
    Deprecated.
    since 9.3 this method is not intended for external use
    void
    Deprecated.
    since 9.3 this method is not intended for external use
    boolean
     
    void
    Processes the expiration event queue.
    default void
    Deprecated.
    since 9.3 There is no reason for this method and is implementation specific
    default void
    Deprecated.
    since 9.3 There is no reason for this method and is implementation specific
  • Method Details

    • processExpiration

      void processExpiration()
      Processes the expiration event queue.
    • isEnabled

      boolean isEnabled()
      Returns:
      true if expiration reaper thread is enabled, false otherwise
    • handleInMemoryExpiration

      @Deprecated void handleInMemoryExpiration(org.infinispan.container.entries.InternalCacheEntry<K,V> entry, long currentTime)
      Deprecated.
      since 9.3 this method is not intended for external use
      This should be invoked passing in an entry that is now expired. This method may attempt to lock this key to preserve atomicity.
      Parameters:
      entry - entry that is now expired
      currentTime - the current time in milliseconds
    • handleInStoreExpiration

      @Deprecated void handleInStoreExpiration(K key)
      Deprecated.
      since 9.3 this method is not intended for external use
      This is to be invoked when a store entry expires. This method may attempt to lock this key to preserve atomicity.

      Note this method doesn't currently take a InternalCacheEntry and this is due to a limitation in the cache store API. This may cause some values to be removed if they were updated at the same time.

      Parameters:
      key - the key of the expired entry
    • handleInStoreExpiration

      @Deprecated void handleInStoreExpiration(MarshallableEntry<K,V> marshalledEntry)
      Deprecated.
      since 9.3 this method is not intended for external use
      This is to be invoked when a store entry expires and the value and/or metadata is available to be used. This method is preferred over handleInStoreExpiration(Object) as it allows for more specific expiration to possibly occur.
      Parameters:
      marshalledEntry - the entry that can be unmarshalled as needed
    • registerWriteIncoming

      @Deprecated default void registerWriteIncoming(K key)
      Deprecated.
      since 9.3 There is no reason for this method and is implementation specific
      This is to be invoked with a when a write is known to occur to prevent expiration from happening. This way we won't have a swarm of remote calls required.
      Parameters:
      key - the key to use
    • unregisterWrite

      @Deprecated default void unregisterWrite(K key)
      Deprecated.
      since 9.3 There is no reason for this method and is implementation specific
      This should always be invoked after registering write but after performing any operations required.
      Parameters:
      key - the key to use