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 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 TypeMethodDescriptionvoidhandleInMemoryExpiration(org.infinispan.container.entries.InternalCacheEntry<K, V> entry, long currentTime) Deprecated.since 9.3 this method is not intended for external usevoidhandleInStoreExpiration(K key) Deprecated.since 9.3 this method is not intended for external usevoidhandleInStoreExpiration(MarshallableEntry<K, V> marshalledEntry) Deprecated.since 9.3 this method is not intended for external usebooleanvoidProcesses the expiration event queue.default voidregisterWriteIncoming(K key) Deprecated.since 9.3 There is no reason for this method and is implementation specificdefault voidunregisterWrite(K key) 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 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.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
InternalCacheEntryand 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.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.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.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
-