Class PartitionedCacheBinaryEntryStore<K,​V>

  • Type Parameters:
    K - key type
    V - value type
    All Implemented Interfaces:
    BinaryEntryStore

    public class PartitionedCacheBinaryEntryStore<K,​V>
    extends Object
    implements BinaryEntryStore
    Generic Coherence BinaryEntryStore for Coherence JCache Adapter.
    Version:
    Coherence 12.1.3
    Author:
    jf 2013.07.08
    • Constructor Detail

      • PartitionedCacheBinaryEntryStore

        public PartitionedCacheBinaryEntryStore​(String sName,
                                                BackingMapManagerContext mgrCtx,
                                                ClassLoader classLoader)
        Construct a native Coherence CacheStore which implements JCache read-through and write-through semantics.
        Parameters:
        sName - internal Coherence NamedCache cache name. encodes the JCache CacheManager context.
        mgrCtx - Coherence context for NamedCache
        classLoader - 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.
        
           &lt;cachestore-scheme&gt;
              &lt;class-scheme&gt;
                 &lt;class-name&gt;com.tangosol.coherence.jcache.partitionedcache.PartitionedCacheBinaryEntryStore&lt;/class-name&gt;
                    &lt;init-params&gt;
                        &lt;init-param&gt;
                            &lt;param-type>java.lang.String&lt;/param-type&gt;
                            &lt;param-value>{cache-name}&lt;/param-value&gt;
                        &lt;/init-param&gt;
                        &lt;init-param&gt;
                            &lt;param-type&gt;com.tangosol.net.BackingMapManagerContext&lt;/param-type&gt;
                            &lt;param-value&gt;{manager-context}&lt;/param-value&gt;
                        &lt;/init-param&gt;
                        &lt;init-param&gt;
                            &lt;param-type&gt;java.lang.ClassLoader&lt;/param-type&gt;
                            &lt;param-value&gt;{class-loader}&lt;/param-value&gt;
                       &lt;/init-param&gt;
                  &lt;/init-params&gt;
                &lt;/class-scheme&gt;
           &lt;/cachestore-scheme&gt;
         
    • Method Detail

      • load

        public void load​(BinaryEntry binaryEntry)
        Description copied from interface: BinaryEntryStore
        Load the value from the underlying store and update the specified entry. If the BinaryEntryStore is capable of loading Binary values, it should update the entry using the {#link BinaryEntry.updateBinaryValue} API.
        Specified by:
        load in interface BinaryEntryStore<K,​V>
        Parameters:
        binaryEntry - an entry that needs to be updated with the loaded value
      • loadAll

        public void loadAll​(Set set)
        Description copied from interface: BinaryEntryStore
        Load the values from the underlying store and update the specified entries. If the BinaryEntryStore is capable of loading Binary values, it should update the entry using the {#link BinaryEntry.updateBinaryValue} API.
        Specified by:
        loadAll in interface BinaryEntryStore<K,​V>
        Parameters:
        set - a set of entries that needs to be updated with the loaded values
      • store

        public void store​(BinaryEntry binaryEntry)
        Description copied from interface: BinaryEntryStore
        Store the specified entry in the underlying store. This method is intended to support both the entry creation and value update.

        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).

        Specified by:
        store in interface BinaryEntryStore<K,​V>
        Parameters:
        binaryEntry - the entry to be stored
      • storeAll

        public void storeAll​(Set set)
        Description copied from interface: BinaryEntryStore
        Store the entries in the specified set in the underlying store. This method is intended to support both the entry creation and value update.

        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).

        Specified by:
        storeAll in interface BinaryEntryStore<K,​V>
        Parameters:
        set - the set of entries to be stored
      • erase

        public void erase​(BinaryEntry binaryEntry)
        Description copied from interface: BinaryEntryStore
        Remove the specified entry from the underlying store.
        Specified by:
        erase in interface BinaryEntryStore<K,​V>
        Parameters:
        binaryEntry - the entry to be removed from the store
      • eraseAll

        public void eraseAll​(Set setBinEntries)
        Description copied from interface: BinaryEntryStore
        Remove the specified entries from the underlying store.

        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.

        Specified by:
        eraseAll in interface BinaryEntryStore<K,​V>
        Parameters:
        setBinEntries - the set entries to be removed from the store