Class PlatformDotNetCacheStore<K,​V>

  • All Implemented Interfaces:
    javax.cache.integration.CacheLoader<K,​V>, javax.cache.integration.CacheWriter<K,​V>, CacheStore<K,​V>, PlatformCacheStore, LifecycleAware

    public class PlatformDotNetCacheStore<K,​V>
    extends Object
    implements CacheStore<K,​V>, PlatformCacheStore, LifecycleAware
    Wrapper for .NET cache store implementations.

    This wrapper should be used if you have an implementation of GridGain.Cache.IGridCacheStore interface in .NET and would like to configure it a persistence storage for your cache. If properly configured, this wrapper will instantiate an instance of your cache store in .NET and delegate all calls to that instance. To create an instance, assembly name and class name are passed to System.Activator.CreateInstance(String, String) method in .NET during node startup. Refer to its documentation for details.

    • Constructor Detail

      • PlatformDotNetCacheStore

        public PlatformDotNetCacheStore()
        Default ctor.
      • PlatformDotNetCacheStore

        public PlatformDotNetCacheStore​(Object nativeFactory)
        Native factory ctor.
    • Method Detail

      • getTypeName

        public String getTypeName()
        Gets .NET class name.
        Returns:
        .NET class name.
      • setTypeName

        public void setTypeName​(String typName)
        Sets .NET class name.
        Parameters:
        typName - .NET class name.
      • getProperties

        public Map<String,​?> getProperties()
        Get properties.
        Returns:
        Properties.
      • setProperties

        public void setProperties​(Map<String,​?> props)
        Set properties.
        Parameters:
        props - Properties.
      • load

        @Nullable
        public V load​(K key)
        Specified by:
        load in interface javax.cache.integration.CacheLoader<K,​V>
      • loadAll

        public Map<K,​V> loadAll​(Iterable<? extends K> keys)
        Specified by:
        loadAll in interface javax.cache.integration.CacheLoader<K,​V>
      • write

        public void write​(javax.cache.Cache.Entry<? extends K,​? extends V> entry)
        Specified by:
        write in interface javax.cache.integration.CacheWriter<K,​V>
      • writeAll

        public void writeAll​(Collection<javax.cache.Cache.Entry<? extends K,​? extends V>> entries)
        Specified by:
        writeAll in interface javax.cache.integration.CacheWriter<K,​V>
      • delete

        public void delete​(Object key)
        Specified by:
        delete in interface javax.cache.integration.CacheWriter<K,​V>
      • deleteAll

        public void deleteAll​(Collection<?> keys)
        Specified by:
        deleteAll in interface javax.cache.integration.CacheWriter<K,​V>
      • sessionEnd

        public void sessionEnd​(boolean commit)
        Tells store to commit or rollback a transaction depending on the value of the 'commit' parameter.
        Specified by:
        sessionEnd in interface CacheStore<K,​V>
        Parameters:
        commit - True if transaction should commit, false for rollback.
      • write

        protected void write​(BinaryRawWriterEx writer,
                             boolean convertBinary)
        Write store data to a stream.
        Parameters:
        writer - Writer.
        convertBinary - Convert binary flag.