@ThreadSafe
public interface ExpirationManager<K,V>
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.
Modifier and Type | Method and Description |
---|---|
void |
handleInMemoryExpiration(InternalCacheEntry<K,V> entry,
long currentTime)
This should be invoked passing in an entry that is now expired.
|
void |
handleInStoreExpiration(K key)
This is to be invoked when a store entry expires.
|
void |
handleInStoreExpiration(MarshalledEntry<K,V> marshalledEntry)
This is to be invoked when a store entry expires and the value and/or metadata is available to be used.
|
boolean |
isEnabled() |
void |
processExpiration()
Processes the expiration event queue.
|
void |
registerWriteIncoming(K key)
This is to be invoked with a when a write is known to occur to prevent expiration from happening.
|
void |
unregisterWrite(K key)
This should always be invoked after registering write but after performing any operations required.
|
void processExpiration()
boolean isEnabled()
void handleInMemoryExpiration(InternalCacheEntry<K,V> entry, long currentTime)
entry
- entry that is now expiredcurrentTime
- the current time in millisecondsvoid handleInStoreExpiration(K key)
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.
key
- the key of the expired entryvoid handleInStoreExpiration(MarshalledEntry<K,V> marshalledEntry)
handleInStoreExpiration(Object)
as it allows for more
specific expiration to possibly occur.marshalledEntry
- the entry that can be unmarshalled as neededvoid registerWriteIncoming(K key)
key
- the key to usevoid unregisterWrite(K key)
key
- the key to useCopyright © 2018 JBoss, a division of Red Hat. All rights reserved.