public boolean remove()

in src/main/java/org/apache/geronimo/jcache/simple/SimpleCache.java [336:362]


    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 SimpleKey<K> cacheKey = new SimpleKey<>(key);

        final SimpleElement<V> v = delegate.remove(cacheKey);
        if (v == null || v.isExpired()) {
            return false;
        }

        final V value = v.getElement();
        for (final SimpleListener<K, V> listener : listeners.values()) {
            listener.onRemoved(Collections.<CacheEntryEvent<? extends K, ? extends V>> singletonList(
                    new SimpleEvent<>(this, EventType.REMOVED, value, key, value)));
        }
        if (statisticsEnabled) {
            statistics.increaseRemovals(1);
            statistics.addRemoveTime(Times.now(false) - start);
        }

        return true;
    }