public Map getAll(List keys) { if (_cache == null) return null; try { return _cache.getAll(keys); } catch (RuntimeException re) { throw translate(re); } } }
public Map<Object,DataCachePCData> getAll(List<Object> keys) { if (_cache == null) return null; try { return _cache.getAll(keys); } catch (RuntimeException re) { throw translate(re); } }
public Map<Object,DataCachePCData> getAll(List<Object> keys) { if (_cache == null) return null; try { return _cache.getAll(keys); } catch (RuntimeException re) { throw translate(re); } }
public Map<Object,DataCachePCData> getAll(List<Object> keys) { if (_cache == null) return null; try { return _cache.getAll(keys); } catch (RuntimeException re) { throw translate(re); } }
public Map<Object,DataCachePCData> getAll(List<Object> keys) { if (_cache == null) return null; try { return _cache.getAll(keys); } catch (RuntimeException re) { throw translate(re); } }
/** * Transforms a collection of {@link PCDataHolder}s that might contain * stale instances into a collection of up-to-date {@link DataCachePCData}s. */ private List<DataCachePCData> transformToVersionSafePCDatas(DataCache cache, List<PCDataHolder> holders) { List<DataCachePCData> transformed = new ArrayList<DataCachePCData>(holders.size()); Map<Object,Integer> ids = new HashMap<Object,Integer>(holders.size()); // this list could be removed if DataCache.getAll() took a Collection List<Object> idList = new ArrayList<Object>(holders.size()); int i = 0; for (PCDataHolder holder : holders) { ids.put(holder.sm.getObjectId(), i++); idList.add(holder.sm.getObjectId()); } Map<Object,DataCachePCData> pcdatas = cache.getAll(idList); for (Entry<Object,DataCachePCData> entry : pcdatas.entrySet()) { Integer index = ids.get(entry.getKey()); DataCachePCData oldpc = entry.getValue(); PCDataHolder holder = holders.get(index); if (oldpc != null && compareVersion(holder.sm, holder.sm.getVersion(), oldpc.getVersion()) == VERSION_EARLIER) continue; else transformed.add(holder.pcdata); } return transformed; }
/** * Transforms a collection of {@link PCDataHolder}s that might contain * stale instances into a collection of up-to-date {@link DataCachePCData}s. */ private void transformToVersionSafePCDatas(DataCache cache, List holders) { Map<Object,Integer> ids = new HashMap<Object,Integer>(holders.size()); // this list could be removed if DataCache.getAll() took a Collection List idList = new ArrayList(holders.size()); int i = 0; for (PCDataHolder holder : (List<PCDataHolder>) holders) { ids.put(holder.sm.getObjectId(), i++); idList.add(holder.sm.getObjectId()); } Map<Object,DataCachePCData> pcdatas = cache.getAll(idList); for (Entry<Object,DataCachePCData> entry : pcdatas.entrySet()) { Integer index = ids.get(entry.getKey()); DataCachePCData oldpc = entry.getValue(); PCDataHolder holder = (PCDataHolder) holders.get(index); if (oldpc != null && compareVersion(holder.sm, holder.sm.getVersion(), oldpc.getVersion()) == VERSION_EARLIER) holders.remove(index); else holders.set(index, holder.pcdata); } }
/** * Transforms a collection of {@link PCDataHolder}s that might contain * stale instances into a collection of up-to-date {@link DataCachePCData}s. */ private List<DataCachePCData> transformToVersionSafePCDatas(DataCache cache, List<PCDataHolder> holders) { List<DataCachePCData> transformed = new ArrayList<DataCachePCData>(holders.size()); Map<Object,Integer> ids = new HashMap<Object,Integer>(holders.size()); // this list could be removed if DataCache.getAll() took a Collection List<Object> idList = new ArrayList<Object>(holders.size()); int i = 0; for (PCDataHolder holder : holders) { ids.put(holder.sm.getObjectId(), i++); idList.add(holder.sm.getObjectId()); } Map<Object,DataCachePCData> pcdatas = cache.getAll(idList); for (Entry<Object,DataCachePCData> entry : pcdatas.entrySet()) { Integer index = ids.get(entry.getKey()); DataCachePCData oldpc = entry.getValue(); PCDataHolder holder = holders.get(index); if (oldpc != null && compareVersion(holder.sm, holder.sm.getVersion(), oldpc.getVersion()) == VERSION_EARLIER) continue; else transformed.add(holder.pcdata); } return transformed; }
/** * Transforms a collection of {@link PCDataHolder}s that might contain * stale instances into a collection of up-to-date {@link DataCachePCData}s. */ private List<DataCachePCData> transformToVersionSafePCDatas(DataCache cache, List<PCDataHolder> holders) { List<DataCachePCData> transformed = new ArrayList<DataCachePCData>(holders.size()); Map<Object,Integer> ids = new HashMap<Object,Integer>(holders.size()); // this list could be removed if DataCache.getAll() took a Collection List<Object> idList = new ArrayList<Object>(holders.size()); int i = 0; for (PCDataHolder holder : holders) { ids.put(holder.sm.getObjectId(), i++); idList.add(holder.sm.getObjectId()); } Map<Object,DataCachePCData> pcdatas = cache.getAll(idList); for (Entry<Object,DataCachePCData> entry : pcdatas.entrySet()) { Integer index = ids.get(entry.getKey()); DataCachePCData oldpc = entry.getValue(); PCDataHolder holder = holders.get(index); if (oldpc != null && compareVersion(holder.sm, holder.sm.getVersion(), oldpc.getVersion()) == VERSION_EARLIER) continue; else transformed.add(holder.pcdata); } return transformed; }
/** * Transforms a collection of {@link PCDataHolder}s that might contain * stale instances into a collection of up-to-date {@link DataCachePCData}s. */ private List<DataCachePCData> transformToVersionSafePCDatas(DataCache cache, List<PCDataHolder> holders) { List<DataCachePCData> transformed = new ArrayList<DataCachePCData>(holders.size()); Map<Object,Integer> ids = new HashMap<Object,Integer>(holders.size()); // this list could be removed if DataCache.getAll() took a Collection List<Object> idList = new ArrayList<Object>(holders.size()); int i = 0; for (PCDataHolder holder : holders) { ids.put(holder.sm.getObjectId(), i++); idList.add(holder.sm.getObjectId()); } Map<Object,DataCachePCData> pcdatas = cache.getAll(idList); for (Entry<Object,DataCachePCData> entry : pcdatas.entrySet()) { Integer index = ids.get(entry.getKey()); DataCachePCData oldpc = entry.getValue(); PCDataHolder holder = holders.get(index); if (oldpc != null && compareVersion(holder.sm, holder.sm.getVersion(), oldpc.getVersion()) == VERSION_EARLIER) continue; else transformed.add(holder.pcdata); } return transformed; }
Map dataMap = cache.getAll(oidList);
Map<Object,DataCachePCData> dataMap = cache.getAll(oidList);
Map<Object,DataCachePCData> dataMap = cache.getAll(oidList);
Map<Object,DataCachePCData> dataMap = cache.getAll(oidList);
Map<Object,DataCachePCData> dataMap = cache.getAll(oidList);