/** * Add a descriptor to the cache. * * @param wikiAlias Alias of the wiki to get * @param descriptor descriptor to add */ public void addFromAlias(String wikiAlias, DefaultWikiDescriptor descriptor) { this.wikiAliasCache.set(wikiAlias, descriptor); }
/** * {@inheritDoc} * * @see com.xpn.xwiki.user.api.XWikiGroupService#flushCache() */ public void flushCache() { if (this.memberGroupsCache != null) { this.memberGroupsCache.removeAll(); } }
@Override public void initialize() throws InitializationException { try { CacheConfiguration configuration = new CacheConfiguration(ICON_SET_CACHE_ID); CacheFactory cacheFactory = cacheManager.getCacheFactory(); this.cache = cacheFactory.newCache(configuration); } catch (ComponentLookupException | CacheException e) { throw new InitializationException("Failed to initialize the IconSet Cache.", e); } }
/** * Get a descriptor from the cache. * * @param wikiAlias Alias of the wiki to get * @return the descriptor related to the alias or null if there is no corresponding descriptor in the cache */ public DefaultWikiDescriptor getFromAlias(String wikiAlias) { return wikiAliasCache.get(wikiAlias); }
/** * @param uid remove the bundle from the cache */ void clear(String uid) { this.onDemandBundleCache.remove(uid); }
@Override public CacheFactory getCacheFactory() throws ComponentLookupException { return getCacheFactory(this.configuration.getDefaultCache()); }
/** * Add a descriptor to the cache. * * @param wikiId Id of the wiki to get * @param descriptor descriptor to add */ public void addFromId(String wikiId, DefaultWikiDescriptor descriptor) { this.wikiIdCache.set(wikiId, descriptor); }
/** * Get a descriptor from the cache. * * @param wikiId Id of the wiki to get * @return the descriptor related to the id or null if there is no corresponding descriptor in the cache */ public DefaultWikiDescriptor getFromId(String wikiId) { return wikiIdCache.get(wikiId); }
protected void onCacheCleanup(Event event, Object source, Object data) { // TODO: do finer grain cache invalidation this.cache.removeAll(); }
public void flushEntry(String key) { this.cache.remove(key); }
public void putInCache(String key, Object obj) { this.cache.set(key, obj); }
/** * Remove a descriptor from the cache. * * @param wikiId the wiki id to remove * @param aliases the wiki aliases to remove * @since 8.4.6 * @since 9.9RC1 */ public void remove(String wikiId, List<String> aliases) { // Remove from the wiki name cache this.wikiIdCache.remove(wikiId); // Remove from the wiki alias cache for (String alias : aliases) { this.wikiAliasCache.remove(alias); } }
@Override public void flushCache() { if (this.feedCache != null) { this.feedCache.dispose(); } this.feedCache = null; }
@Override public void clear() { cache.removeAll(); }
/** * {@inheritDoc} * * @see XWikiPluginInterface#flushCache() */ @Override public void flushCache() { if (this.imageCache != null) { this.imageCache.dispose(); } this.imageCache = null; }
@Override public int reindex(String ontologyUrl) { // Remote vocabulary, we cannot reindex, but we can clear the local cache this.cache.removeAll(); return 0; }
public void flushAll() { this.cache.removeAll(); }