Class IgniteLockService
- java.lang.Object
-
- com.broadleafcommerce.search.index.ignite.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)
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_REINDEX_LOCK_CACHE_NAME
-
Constructor Summary
Constructors Constructor Description IgniteLockService(org.apache.ignite.Ignite ignite, org.apache.ignite.configuration.CacheConfiguration<String,Object> cacheConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
protected org.apache.ignite.IgniteCache<String,Object>
getCache()
boolean
isDistributed()
boolean
isLocked(String lockName)
String
lock(String lockName)
void
unlock(String lockName, String lockKey)
-
-
-
Field Detail
-
DEFAULT_REINDEX_LOCK_CACHE_NAME
public static final String DEFAULT_REINDEX_LOCK_CACHE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
isDistributed
public final boolean isDistributed()
- Specified by:
isDistributed
in interfacecom.broadleafcommerce.search.index.core.Distributable
-
isLocked
public boolean isLocked(@NonNull String lockName)
- Specified by:
isLocked
in interfacecom.broadleafcommerce.search.index.core.LockService
-
lock
public String lock(@NonNull String lockName) throws com.broadleafcommerce.search.index.core.LockException
- Specified by:
lock
in interfacecom.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 interfacecom.broadleafcommerce.search.index.core.LockService
- Throws:
com.broadleafcommerce.search.index.core.LockException
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
-
-