/** * @param keys Keys to remove. */ private void retryRemoveAll(final Collection<SetItemKey> keys) { retry(new Callable<Void>() { @Override public Void call() throws Exception { cache.removeAll(keys); return null; } }); }
/** * @param keys Keys to remove. */ private void retryPutAll(final Map<SetItemKey, Boolean> keys) { retry(new Callable<Void>() { @Override public Void call() throws Exception { cache.putAll(keys); return null; } }); }
/** {@inheritDoc} */ @Override public boolean add(T o) { onAccess(); final SetItemKey key = itemKey(o); return retry(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return cache.putIfAbsent(key, true); } }); }
/** {@inheritDoc} */ @Override public boolean remove(Object o) { onAccess(); final SetItemKey key = itemKey(o); return retry(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return cache.remove(key); } }); }
/** {@inheritDoc} */ @Override public boolean contains(Object o) { onAccess(); final SetItemKey key = itemKey(o); return retry(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return cache.get(key) != null; } }); }
/** * @param keys Keys to remove. */ private void retryPutAll(final Map<SetItemKey, Boolean> keys) { retry(new Callable<Void>() { @Override public Void call() throws Exception { cache.putAll(keys); return null; } }); }
/** * @param keys Keys to remove. */ private void retryRemoveAll(final Collection<SetItemKey> keys) { retry(new Callable<Void>() { @Override public Void call() throws Exception { cache.removeAll(keys); return null; } }); }
/** {@inheritDoc} */ @Override public boolean add(T o) { onAccess(); final SetItemKey key = itemKey(o); return retry(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return cache.putIfAbsent(key, true); } }); }
/** {@inheritDoc} */ @Override public boolean contains(Object o) { onAccess(); final SetItemKey key = itemKey(o); return retry(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return cache.get(key) != null; } }); }
/** {@inheritDoc} */ @Override public boolean remove(Object o) { onAccess(); final SetItemKey key = itemKey(o); return retry(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return cache.remove(key); } }); }