Package com.axelor.cache
Interface DistributedService
- All Known Implementing Classes:
CaffeineDistributedService,RedissonDistributedService
public interface DistributedService
Service for getting distributed-aware objects.
-
Method Summary
Modifier and TypeMethodDescriptiongetAtomicLong(String name) Returns distributed-aware atomic long.Returns general-purpose distributed-aware lock.default LockgetLockIfDistributed(String name) Returns a lock that locks only when the cache is distributed.
-
Method Details
-
getLock
Returns general-purpose distributed-aware lock.- Parameters:
name- name of the lock- Returns:
- distributed-aware reentrant lock
-
getLockIfDistributed
Returns a lock that locks only when the cache is distributed.This is useful when no locking is needed in single-instance setup.
- Parameters:
name- name of the lock- Returns:
- distributed reentrant lock or no-op lock if cache is not distributed
-
getAtomicLong
Returns distributed-aware atomic long.- Parameters:
name-- Returns:
- distributed-aware atomic long
-