/** * @see org.springframework.cache.Cache#evict(java.lang.Object) */ @Override public void evict(final Object key) { this.nativeCache.remove(key); }
/** * @see org.springframework.cache.Cache#evict(Object) */ @Override public void evict(final Object key) { try { if (writeTimeout > 0) this.nativeCache.removeAsync(key).get(writeTimeout, TimeUnit.MILLISECONDS); else this.nativeCache.remove(key); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new CacheException(e); } catch (ExecutionException | TimeoutException e) { throw new CacheException(e); } }
@Override public void confirm(CamelContext camelContext, String exchangeId) { LOG.trace("Confirming an exchange with ID {}.", exchangeId); cache.remove(exchangeId); }
@Override public void confirm(CamelContext camelContext, String exchangeId) { LOG.trace("Confirming an exchange with ID {}.", exchangeId); cache.remove(exchangeId); }
@Override public void remove(CamelContext camelContext, String key, Exchange exchange) { LOG.trace("Removing an exchange with ID {} for key {}", exchange.getExchangeId(), key); cache.remove(key); }
@Override public void remove(CamelContext camelContext, String key, Exchange exchange) { LOG.trace("Removing an exchange with ID {} for key {}", exchange.getExchangeId(), key); cache.remove(key); }
@Override @ManagedOperation(description = "Remove the key from the store") public boolean remove(Object key) { return getCache().remove(key) != null; }
@Override public void clearMissing( final ConcreteResource resource ) { String key = getResourceKey( resource ); nfcCache.execute( cache -> cache.remove( key ) ); }
@InvokeOnHeader("REMOVE") @InvokeOnHeader(InfinispanConstants.REMOVE) void onRemove(Message message) { final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName); final Object key = message.getHeader(InfinispanConstants.KEY); final Object value = message.getHeader(InfinispanConstants.VALUE); final Object result; if (ObjectHelper.isEmpty(value)) { result = cache.remove(key); } else { result = cache.remove(key, value); } setResult(message, result); }
private void removeFromCache(String cacheKey) { // More attempts to send the message (it may fail if some node fails in the meantime) Retry.executeWithBackoff((int iteration) -> { crossDCAwareCacheFactory.getCache().remove(cacheKey); if (logger.isTraceEnabled()) { logger.tracef("Task %s removed from the cache", cacheKey); } }, 10, 10); }
@Override public Map<String, String> remove(UUID codeId) { try { BasicCache<UUID, ActionTokenValueEntity> cache = codeCache.get(); ActionTokenValueEntity existing = cache.remove(codeId); return existing == null ? null : existing.getNotes(); } catch (HotRodClientException re) { // No need to retry. The hotrod (remoteCache) has some retries in itself in case of some random network error happened. // In case of lock conflict, we don't want to retry anyway as there was likely an attempt to remove the code from different place. if (logger.isDebugEnabled()) { logger.debugf(re, "Failed when removing code %s", codeId); } return null; } }
@Override public boolean delete(String id) throws Exception { if (LOG.isDebugEnabled()) LOG.debug("Deleting session with id {} from infinispan", id); return (_cache.remove(getCacheKey(id)) != null); }
@Override public void clearMissing( final Location location ) { nfcCache.execute( (cache) -> { Set<String> paths = getMissing( location ); paths.forEach( path -> cache.remove( getResourceKey( new ConcreteResource( location, path ) ) ) ); return null; } ); }