mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
93934: Merged BRANCHES/DEV/mward/post50_hbf_fixes to BRANCHES/DEV/HEAD-BUG-FIX: 92706: ACE-1239 Updated LockStoreImpl to use later non-deprecated API (CacheBuilder) from Google Guava. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@95010 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,7 +24,8 @@ import java.util.concurrent.TimeUnit;
|
||||
import org.alfresco.repo.lock.LockServiceImpl;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
import com.google.common.collect.MapMaker;
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
|
||||
/**
|
||||
* {@link LockStore} implementation backed by a Google {@link ConcurrentMap}.
|
||||
@@ -53,10 +54,10 @@ public class LockStoreImpl extends AbstractLockStore<ConcurrentMap<NodeRef, Lock
|
||||
|
||||
private static ConcurrentMap<NodeRef, LockState> createMap(long expiry, TimeUnit timeUnit)
|
||||
{
|
||||
ConcurrentMap<NodeRef, LockState> map = new MapMaker()
|
||||
Cache<NodeRef, LockState> cache = CacheBuilder.newBuilder()
|
||||
.concurrencyLevel(32)
|
||||
.expiration(expiry, timeUnit)
|
||||
.makeMap();
|
||||
return map;
|
||||
.expireAfterWrite(expiry, timeUnit)
|
||||
.build();
|
||||
return cache.asMap();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user