@Override public void set(String key, T value) { T old = cache.put(key, value); if (listener != null && old == null) { listener.cacheEntryAdded(getEvent(key, value)); } else { listener.cacheEntryModified(getEvent(key, value)); } lastInsertedKey = key; }
/** * Helper method to send event when a cache entry is modified. * * @param event the event to send. */ protected void sendEntryModifiedEvent(CacheEntryEvent<T> event) { for (org.xwiki.cache.event.CacheEntryListener<T> listener : this.cacheEntryListeners.getListeners(org.xwiki.cache.event.CacheEntryListener.class)) { listener.cacheEntryModified(event); } }