public void addExpirationListener(ExpirationListener listen) { addListener(listen); }
protected void close(boolean clear) { if (!_closed) { if (clear) clearInternal(); _closed = true; } }
public void close() { close(true); }
public boolean contains(Object key) { DataCachePCData o = getInternal(key); if (o != null && o.isTimedOut()) { o = null; removeInternal(key); if (log.isTraceEnabled()) log.trace(s_loc.get("cache-timeout", key)); } return o != null; }
public void clear() { clearInternal(); if (log.isTraceEnabled()) log.trace(s_loc.get("cache-clear", getName())); }
/** * Invoke when a key is removed from this cache. Propagates the * expiration event on to all expiration listeners registered * with this class. */ protected void keyRemoved(Object key, boolean expired) { // Notify any expiration listeners of the expiration. if (hasListeners()) fireEvent(new ExpirationEvent(this, key, expired)); if (expired && log.isTraceEnabled()) log.trace(s_loc.get("cache-expired", key)); }
public void unpinAll(Class<?> cls, boolean subs) { if (log.isWarnEnabled()) log.warn(s_loc.get("cache-class-unpin", getName())); }
public BitSet containsAll(Collection<Object> keys) { if (keys.isEmpty()) return EMPTY_BITSET; BitSet set = new BitSet(keys.size()); int i = 0; for (Iterator<Object> iter = keys.iterator(); iter.hasNext(); i++) if (contains(iter.next())) set.set(i); return set; }
/** * Returns the objects for the given key List. */ public Map<Object,DataCachePCData> getAll(List<Object> keys) { Map<Object,DataCachePCData> resultMap = new HashMap<Object,DataCachePCData>(keys.size()); for (Object key : keys) resultMap.put(key, get(key)); return resultMap; }
public void initialize(DataCacheManager mgr) { super.initialize(mgr); conf.getRemoteCommitEventManager().addInternalListener(this); }
public boolean contains(Object key) { DataCachePCData o = getInternal(key); if (o != null && o.isTimedOut()) { o = null; removeInternal(key); if (log.isTraceEnabled()) log.trace(s_loc.get("cache-timeout", key)); } return o != null; }
public void clear() { clearInternal(); if (log.isTraceEnabled()) log.trace(s_loc.get("cache-clear", getName())); }
/** * Invoke when a key is removed from this cache. Propagates the * expiration event on to all expiration listeners registered * with this class. */ protected void keyRemoved(Object key, boolean expired) { // Notify any expiration listeners of the expiration. if (hasListeners()) fireEvent(new ExpirationEvent(this, key, expired)); if (expired && log.isTraceEnabled()) log.trace(s_loc.get("cache-expired", key)); }
public void pinAll(Class<?> cls, boolean subs) { if (log.isWarnEnabled()) log.warn(s_loc.get("cache-class-pin", getName())); }
public BitSet containsAll(Collection<Object> keys) { if (keys.isEmpty()) return EMPTY_BITSET; BitSet set = new BitSet(keys.size()); int i = 0; for (Iterator<Object> iter = keys.iterator(); iter.hasNext(); i++) if (contains(iter.next())) set.set(i); return set; }
/** * Returns the objects for the given key List. */ public Map<Object,DataCachePCData> getAll(List<Object> keys) { Map<Object,DataCachePCData> resultMap = new HashMap<Object,DataCachePCData>(keys.size()); for (Object key : keys) resultMap.put(key, get(key)); return resultMap; }
public void initialize(DataCacheManager mgr) { super.initialize(mgr); conf.getRemoteCommitEventManager().addInternalListener(this); // Wait to instantiate _cache so that we know the proper value of _cache _cache = newCacheMap(); if (_cacheSize != Integer.MIN_VALUE) { _cache.setCacheSize(_cacheSize); } if (_softRefs != Integer.MIN_VALUE) { _cache.setSoftReferenceSize(_softRefs); } }
public boolean contains(Object key) { DataCachePCData o = getInternal(key); if (o != null && o.isTimedOut()) { o = null; removeInternal(key); if (log.isTraceEnabled()) log.trace(s_loc.get("cache-timeout", key)); } return o != null; }
public void clear() { clearInternal(); if (log.isTraceEnabled()) log.trace(s_loc.get("cache-clear", getName())); }
/** * Invoke when a key is removed from this cache. Propagates the * expiration event on to all expiration listeners registered * with this class. */ protected void keyRemoved(Object key, boolean expired) { // Notify any expiration listeners of the expiration. if (hasListeners()) fireEvent(new ExpirationEvent(this, key, expired)); if (expired && log.isTraceEnabled()) log.trace(s_loc.get("cache-expired", key)); }