com.scaleoutsoftware.soss.client
Interface BackingStore


public interface BackingStore

Provides a means for a 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).


Method Summary
 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 extends Serializable>
T
load(CachedObjectId<T> id)
          Loads an object from the backing store.
<T extends Serializable>
void
store(CachedObjectId<T> id, T value)
          Persists an object to the backing store.
 

Method Detail

load

<T extends Serializable> T load(CachedObjectId<T> id)
Loads an object from the backing store. Returns null if there is no value in the backing store for the specified id.

Parameters:
id - The identifier of the object to retrieve.
Returns:
The object from the backing store that is to be loaded into ScaleOut StateServer.

store

<T extends Serializable> void store(CachedObjectId<T> id,
                                    T value)
Persists an object to the backing store.

Parameters:
id - The identifier of the object to persist.
value - The cached object to be written to the backing store.

erase

void erase(CachedObjectId id)
Removes an object from the backing store.

Parameters:
id - The identifier of the object to delete.

getCreatePolicy

CreatePolicy getCreatePolicy(CachedObjectId id)
Provides a policy object to be used when a load() operation inserts an object into the NamedCache. If the method returns null then the NamedCache's default CreatePolicy will be used.

Parameters:
id - The identifier of the object to be loaded into the cache.
Returns:
The CreatePolicy to be used when inserting the specified object into the cache or null if the NamedCache's NamedCache.DefaultCreatePolicy is to be used.


Copyright (C) 2007-2012 ScaleOut Software, Inc.