K
- key typeV
- value typepublic class PartitionedCacheBinaryEntryStore<K,V> extends Object implements BinaryEntryStore
Constructor and Description |
---|
PartitionedCacheBinaryEntryStore(String sName,
BackingMapManagerContext mgrCtx,
ClassLoader classLoader)
Construct a native Coherence CacheStore which implements JCache read-through and write-through semantics.
|
Modifier and Type | Method and Description |
---|---|
void |
erase(BinaryEntry binaryEntry)
Remove the specified entry from the underlying store.
|
void |
eraseAll(Set set)
Remove the specified entries from the underlying store.
|
void |
load(BinaryEntry binaryEntry)
Load the value from the underlying store and update the specified entry.
|
void |
loadAll(Set set)
Load the values from the underlying store and update the specified entries.
|
void |
store(BinaryEntry binaryEntry)
Store the specified entry in the underlying store.
|
void |
storeAll(Set set)
Store the entries in the specified set in the underlying store.
|
public PartitionedCacheBinaryEntryStore(String sName, BackingMapManagerContext mgrCtx, ClassLoader classLoader)
sName
- internal Coherence NamedCache cache name. encodes the JCache CacheManager context.mgrCtx
- Coherence context for NamedCacheclassLoader
- classLoader used by the Coherence NamedCache
Only gets called if coherence configuration file defines <cache-scheme> element referring to this class.
Here is the configuration that is now injected into coherence configuration files using the JCache namespace.
<cachestore-scheme>
<class-scheme>
<class-name>com.tangosol.coherence.jcache.partitionedcache.PartitionedCacheBinaryEntryStore</class-name>
<init-params>
<init-param>
<param-type>java.lang.String</param-type>
<param-value>{cache-name}</param-value>
</init-param>
<init-param>
<param-type>com.tangosol.net.BackingMapManagerContext</param-type>
<param-value>{manager-context}</param-value>
</init-param>
<init-param>
<param-type>java.lang.ClassLoader</param-type>
<param-value>{class-loader}</param-value>
</init-param>
</init-params>
</class-scheme>
</cachestore-scheme>
public void load(BinaryEntry binaryEntry)
BinaryEntryStore
load
in interface BinaryEntryStore
binaryEntry
- an entry that needs to be updated with the loaded valuepublic void loadAll(Set set)
BinaryEntryStore
loadAll
in interface BinaryEntryStore
set
- a set of entries that needs to be updated with the
loaded valuespublic void store(BinaryEntry binaryEntry)
BinaryEntryStore
If the store operation changes the entry's value, a best effort will be made to place the changed value back into the corresponding backing map (for asynchronous store operations a concurrent backing map modification can make it impossible).
store
in interface BinaryEntryStore
binaryEntry
- the entry to be storedpublic void storeAll(Set set)
BinaryEntryStore
If this operation fails (by throwing an exception) after a partial success, the convention is that entries which have been stored successfully are to be removed from the specified set, indicating that the store operation for the entries left in the map has failed or has not been attempted.
If the storeAll operation changes some entries' values, a best effort will be made to place the changed values back into the corresponding backing map (for asynchronous store operations concurrent backing map modifications can make it impossible).
storeAll
in interface BinaryEntryStore
set
- the set of entries to be storedpublic void erase(BinaryEntry binaryEntry)
BinaryEntryStore
erase
in interface BinaryEntryStore
binaryEntry
- the entry to be removed from the storepublic void eraseAll(Set set)
BinaryEntryStore
If this operation fails (by throwing an exception) after a partial success, the convention is that entries which have been erased successfully are to be removed from the specified set, indicating that the erase operation for the entries left in the collection has failed or has not been attempted.
eraseAll
in interface BinaryEntryStore
set
- the set entries to be removed from the store