public QueryResult get(QueryKey qk) { if (_cache == null) return null; try { return _cache.get(qk); } catch (RuntimeException re) { throw translate(re); } }
/** * Constructor. Supply delegate result provider and our query key. */ public CachingResultObjectProvider(ResultObjectProvider rop, boolean proj, QueryKey key) { _rop = rop; _proj = proj; _qk = key; _cache.addTypesChangedListener(this); }
public void clear() { if (_cache == null) return; try { _cache.clear(); } catch (RuntimeException re) { throw translate(re); } }
_cache.writeLock(); try { _cache.put(_qk, res); abortCaching(); _cache.writeUnlock();
public void onTypesChanged(TypesChangedEvent e) { if (_cache == null) return; try { _cache.onTypesChanged(e); } catch (RuntimeException re) { throw translate(re); } }
public void initialize(DataCacheManager mgr) { if (_cache == null) return; try { _cache.initialize(mgr); } catch (RuntimeException re) { throw translate(re); } }
/** * Stop caching. */ private void abortCaching() { if (!_maintainCache) return; // this can be called via an event from another thread synchronized (this) { // it's important that we set this flag first so that any // subsequent calls to this object are bypassed. _maintainCache = false; _cache.removeTypesChangedListener(this); _data.clear(); } }
public QueryResult remove(QueryKey qk) { if (_cache == null) return null; try { return _cache.remove(qk); } catch (RuntimeException re) { throw translate(re); } }
public boolean pin(QueryKey qk) { if (_cache == null) return false; try { return _cache.pin(qk); } catch (RuntimeException re) { throw translate(re); } }
public void close() { if (_cache == null) return; try { _cache.close(); } catch (RuntimeException re) { throw translate(re); } } }
public QueryResult put(QueryKey qk, QueryResult oids) { if (_cache == null) return null; try { return _cache.put(qk, oids); } catch (RuntimeException re) { throw translate(re); } }
_cache.writeLock(); try { res.setTimestamp(System.currentTimeMillis()); _cache.put(_qk, res); abortCaching(); _cache.writeUnlock();
public void onTypesChanged(TypesChangedEvent e) { if (_cache == null) return; try { _cache.onTypesChanged(e); } catch (RuntimeException re) { throw translate(re); } }
public void initialize(DataCacheManager mgr) { if (_cache == null) return; try { _cache.initialize(mgr); } catch (RuntimeException re) { throw translate(re); } }
/** * Stop caching. */ private void abortCaching() { if (!_maintainCache) return; // this can be called via an event from another thread synchronized (this) { // it's important that we set this flag first so that any // subsequent calls to this object are bypassed. _maintainCache = false; _cache.removeTypesChangedListener(this); _data.clear(); } }
public QueryResult remove(QueryKey qk) { if (_cache == null) return null; try { return _cache.remove(qk); } catch (RuntimeException re) { throw translate(re); } }
public boolean pin(QueryKey qk) { if (_cache == null) return false; try { return _cache.pin(qk); } catch (RuntimeException re) { throw translate(re); } }
public void close() { if (_cache == null) return; try { _cache.close(); } catch (RuntimeException re) { throw translate(re); } }
public QueryResult put(QueryKey qk, QueryResult oids) { if (_cache == null) return null; try { return _cache.put(qk, oids); } catch (RuntimeException re) { throw translate(re); } }
_cache.writeLock(); try { res.setTimestamp(System.currentTimeMillis()); _cache.put(_qk, res); abortCaching(); _cache.writeUnlock();