public interface BackingStore
NamedCache
to interact with a backing store (such as a database) to perform read-through, write-though, refresh-ahead,
and write-behind operations. To add backing store interaction, register a class implementing this interface by calling
NamedCache.setBackingStoreAdapter(BackingStore, BackingStorePolicy)
.Modifier and Type | Method and Description |
---|---|
void |
erase(CachedObjectId id)
Removes an object from the backing store.
|
CreatePolicy |
getCreatePolicy(CachedObjectId id)
Provides a policy object to be used when a load() operation inserts an object into the
NamedCache . |
<T> T |
load(CachedObjectId<T> id)
Loads an object from the backing store.
|
<T> void |
store(CachedObjectId<T> id,
T value) |
<T> T load(CachedObjectId<T> id)
null
if there is no value in the backing store for the specified id.T
- The type of the object from the backing store that is to be loaded into ScaleOut StateServer.id
- The identifier of the object to retrieve.<T> void store(CachedObjectId<T> id, T value)
T
- The type of the cached object to be written to the backing store.id
- The identifier of the object to persist.value
- The cached object to be written to the backing store.void erase(CachedObjectId id)
id
- The identifier of the object to delete.CreatePolicy getCreatePolicy(CachedObjectId id)
NamedCache
. If the method returns
null
then the NamedCache
's default CreatePolicy
will be used.id
- The identifier of the object to be loaded into the cache.null
if the NamedCache
's
NamedCache.DefaultCreatePolicy is to be used.Copyright (C) 2007-2014 ScaleOut Software, Inc.