Class IgniteLockService

  • All Implemented Interfaces:
    com.broadleafcommerce.search.index.core.Distributable, com.broadleafcommerce.search.index.core.LockService, org.springframework.beans.factory.DisposableBean

    public class IgniteLockService
    extends Object
    implements com.broadleafcommerce.search.index.core.LockService, org.springframework.beans.factory.DisposableBean
    Default implementation of a LockService that provides a distributed Lock mechanism based on functionality provided by Apache Ignite.
    Author:
    Kelly Tisdell (ktisdell)
    • Constructor Detail

      • IgniteLockService

        public IgniteLockService​(org.apache.ignite.Ignite ignite,
                                 org.apache.ignite.configuration.CacheConfiguration<String,​Object> cacheConfig)
    • Method Detail

      • isDistributed

        public final boolean isDistributed()
        Specified by:
        isDistributed in interface com.broadleafcommerce.search.index.core.Distributable
      • isLocked

        public boolean isLocked​(@NonNull
                                String lockName)
        Specified by:
        isLocked in interface com.broadleafcommerce.search.index.core.LockService
      • lock

        public String lock​(@NonNull
                           String lockName)
                    throws com.broadleafcommerce.search.index.core.LockException
        Specified by:
        lock in interface com.broadleafcommerce.search.index.core.LockService
        Throws:
        com.broadleafcommerce.search.index.core.LockException
      • unlock

        public void unlock​(@NonNull
                           String lockName,
                           @NonNull
                           String lockKey)
                    throws com.broadleafcommerce.search.index.core.LockException
        Specified by:
        unlock in interface com.broadleafcommerce.search.index.core.LockService
        Throws:
        com.broadleafcommerce.search.index.core.LockException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean
      • getCache

        protected final org.apache.ignite.IgniteCache<String,​Object> getCache()