Package org.infinispan.expiration
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 usingExpirationConfigurationBuilder.wakeUpInterval(long)
andGlobalConfigurationBuilder.expirationThreadPool()
). If the expiration thread is disabled - by settingExpirationConfigurationBuilder.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
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 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 usevoid
handleInStoreExpiration(K key)
Deprecated.since 9.3 this method is not intended for external usevoid
handleInStoreExpiration(MarshallableEntry<K,V> marshalledEntry)
Deprecated.since 9.3 this method is not intended for external useboolean
isEnabled()
void
processExpiration()
Processes the expiration event queue.default void
registerWriteIncoming(K key)
Deprecated.since 9.3 There is no reason for this method and is implementation specificdefault void
unregisterWrite(K key)
Deprecated.since 9.3 There is no reason for this method and is implementation specific
-
-
-
Method Detail
-
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 useThis 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 expiredcurrentTime
- the current time in milliseconds
-
handleInStoreExpiration
@Deprecated void handleInStoreExpiration(K key)
Deprecated.since 9.3 this method is not intended for external useThis 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 useThis is to be invoked when a store entry expires and the value and/or metadata is available to be used. This method is preferred overhandleInStoreExpiration(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 specificThis 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 specificThis should always be invoked after registering write but after performing any operations required.- Parameters:
key
- the key to use
-
-