Code example for ReferenceQueue

0
 */ 
public class SoftCacheStorage implements ConcurrentCacheStorage 
{ 
    private static final Method atomicRemove = getAtomicRemoveMethod();
     
    private final ReferenceQueue queue = new ReferenceQueue();
    private final Map map;
    private final boolean concurrent;
     
    public SoftCacheStorage() { 
        this(_ConcurrentMapFactory.newMaybeConcurrentHashMap()); 
    } 
     
    public boolean isConcurrent() { 
        return concurrent;
    } 
     
    public SoftCacheStorage(Map backingMap) {
        map = backingMap;
        this.concurrent = _ConcurrentMapFactory.isConcurrent(map);
    }