public interface BackingCacheEntryStore<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>> extends GroupCompatibilityChecker, AffinitySupport<K>
BackingCacheEntry
instances that integrates a persistent store and the ability to use its
knowledge of when objects are accessed to coordinate the passivation and expiration of cached objects. Note that this class
does NOT call any callbacks; it performs passivation and expiration by invoking methods on the
injected backing cache
; the cache performs the actual passivation or
removal.Modifier and Type | Method and Description |
---|---|
E |
get(K key,
boolean lock)
Gets the entry with the given id from the store.
|
BackingCacheEntryStoreConfig |
getConfig() |
StatefulTimeoutInfo |
getTimeout() |
Set<K> |
insert(E entry)
Put a new entry into the store.
|
boolean |
isClustered()
Gets whether this store supports clustering functionality.
|
void |
passivate(E entry)
Remove the entry with the given key from any in-memory store while retaining it in the persistent store.
|
E |
remove(K key)
Remove the object with the given key from the store.
|
void |
start()
Perform any initialization work.
|
void |
stop()
Perform any shutdown work.
|
void |
update(E entry,
boolean modified)
Update an already cached item.
|
isCompatibleWith
getStrictAffinity, getWeakAffinity, hasAffinity
Set<K> insert(E entry)
entry
- the object to store. Cannot be null
.IllegalStateException
- if the store is already managing an entry with the same id
. It
is not a requirement that the store throw this exception in this case, but it is permissible. This basically puts
the onus on callers to ensure this operation is only performed once per entry.E get(K key, boolean lock)
key
- id
of the entry. Cannot be null
.id
. May return null
.void update(E entry, boolean modified)
entry
- the entry to updatemodified
- was the entry modified since #get(Object)
was called?IllegalStateException
- if the store isn't already managing an entry with the same id
.
It is not a requirement that the store throw this exception in this case, but it is permissible. This basically
puts the onus on callers to ensure #insert(E)
is invoked before the first replication.E remove(K key)
key
- id
of the entry. Cannot be null
.key
void passivate(E entry)
entry
- the entry to passivateboolean isClustered()
true
if clustering is supported, false
otherwisevoid start()
void stop()
BackingCacheEntryStoreConfig getConfig()
StatefulTimeoutInfo getTimeout()
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.