/** * Removes an item from the cache. * <p> * @param key * @return true is it was removed * @see org.apache.commons.jcs.engine.behavior.ICache#remove(Object) */ @Override public boolean remove( K key ) { return remove( key, false ); }
/** * Removes an item from the cache. * <p> * @param key * @return true is it was removed * @see org.apache.commons.jcs.engine.behavior.ICache#remove(Object) */ @Override public boolean remove( K key ) { return remove( key, false ); }
/** * Do not propagate removeall laterally or remotely. * <p> * @param key * @return true if the item was already in the cache. */ public boolean localRemove( K key ) { return remove( key, true ); }
/** * Do not propagate removeall laterally or remotely. * <p> * @param key * @return true if the item was already in the cache. */ public boolean localRemove( K key ) { return remove( key, true ); }
/** * Removes a single item by name. * <p> * @param name the name of the item to remove. */ @Override public void remove( K name ) { this.getCacheControl().remove( name ); }
/** * Removes a single item by name. * <p> * @param name the name of the item to remove. */ @Override public void remove( K name ) { this.getCacheControl().remove( name ); }
protected void doExpires(ICacheElement<K, V> element) { missCountExpired.incrementAndGet(); remove( element.getKey() ); }
/** * Invalidates a group: remove all the group members * <p> * @param group * The name of the group to invalidate */ @Override public void invalidateGroup( String group ) { this.getCacheControl().remove(getGroupAttrName(group, null)); } }
/** * @param name * @param group */ @Override public void removeFromGroup( K name, String group ) { GroupAttrName<K> key = getGroupAttrName( group, name ); this.getCacheControl().remove( key ); }
/** * @param name * @param group */ @Override public void removeFromGroup( K name, String group ) { GroupAttrName<K> key = getGroupAttrName( group, name ); this.getCacheControl().remove( key ); }
/** * Invalidates a group: remove all the group members * <p> * @param group * The name of the group to invalidate */ @Override public void invalidateGroup( String group ) { this.getCacheControl().remove(getGroupAttrName(group, null)); } }
private void expires(final K cacheKey) { final ICacheElement<K, V> elt = delegate.get(cacheKey); delegate.remove(cacheKey); for (final JCSListener<K, V> listener : listeners.values()) { listener.onExpired(Arrays.<CacheEntryEvent<? extends K, ? extends V>> asList(new JCSCacheEntryEvent<K, V>(this, EventType.REMOVED, null, cacheKey, elt.getVal()))); } }
remove( element.getKey() ); elementsFromMemory.remove( element.getKey() );
remove( element.getKey() ); elementsFromAuxiliary.remove( element.getKey() );
removeSuccess = c.remove( key );
removeSuccess = c.remove( key );
cacheHub.getCache(cacheName).remove(key);
/** * Processes a remove request. * <p> * If isLocalClusterConsistency is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param key * @param requesterId * @throws IOException */ @Override public void processRemove( String cacheName, K key, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isLocalClusterConsistency(); if ( keepLocal ) { cache.localRemove( key ); } else { cache.remove( key ); } }
/** * Processes a remove request. * <p> * If isLocalClusterConsistency is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param key * @param requesterId * @throws IOException */ @Override public void processRemove( String cacheName, K key, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isLocalClusterConsistency(); if ( keepLocal ) { cache.localRemove( key ); } else { cache.remove( key ); } }
@Override public boolean remove(final K key) { assertNotClosed(); assertNotNull(key, "key"); final boolean statisticsEnabled = config.isStatisticsEnabled(); final long start = Times.now(!statisticsEnabled); writer.delete(key); final K cacheKey = key; final ICacheElement<K, V> v = delegate.get(cacheKey); delegate.remove(cacheKey); final V value = v != null && v.getVal() != null ? v.getVal() : null; boolean remove = v != null; for (final JCSListener<K, V> listener : listeners.values()) { listener.onRemoved(Arrays.<CacheEntryEvent<? extends K, ? extends V>> asList(new JCSCacheEntryEvent<K, V>(this, EventType.REMOVED, null, key, value))); } if (remove && statisticsEnabled) { statistics.increaseRemovals(1); statistics.addRemoveTime(Times.now(false) - start); } return remove; }