org.infinispan.jcache.interceptor.ExpirationTrackingInterceptor Maven / Gradle / Ivy
package org.infinispan.jcache.interceptor;
import org.infinispan.commands.read.GetKeyValueCommand;
import org.infinispan.container.DataContainer;
import org.infinispan.container.entries.InternalCacheEntry;
import org.infinispan.context.InvocationContext;
import org.infinispan.interceptors.base.CommandInterceptor;
import org.infinispan.jcache.JCacheNotifier;
import org.infinispan.util.TimeService;
import javax.cache.Cache;
/**
* An interceptor that tracks expiration of entries and notifies JCache
* {@link javax.cache.event.CacheEntryExpiredListener} instances.
*
* This interceptor must be placed before
* {@link org.infinispan.interceptors.EntryWrappingInterceptor} because this
* interceptor can result in container entries being removed upon expiration
* (alongside their metadata).
*
* TODO: How to track expired entry in cache stores?
* TODO: Could this be used as starting point to centrally track expiration?
* Currently, logic split between data container, cache stores...etc.
*
* @author Galder Zamarreño
* @since 5.3
*/
public class ExpirationTrackingInterceptor extends CommandInterceptor {
private final DataContainer container;
private final Cache
© 2015 - 2025 Weber Informatics LLC | Privacy Policy