protected Collection<? extends Cache> getCaches( CacheOperationInvocationContext<CacheOperation> context, CacheResolver cacheResolver) { Collection<? extends Cache> caches = cacheResolver.resolveCaches(context); if (caches.isEmpty()) { throw new IllegalStateException("No cache could be resolved for '" + context.getOperation() + "' using resolver '" + cacheResolver + "'. At least one cache should be provided per cache operation."); } return caches; }
@Override public Collection<? extends Cache> resolveCaches(CacheOperationInvocationContext<?> context) { return this.cacheResolver.obtain().resolveCaches(context); } }
protected Collection<? extends Cache> getCaches( CacheOperationInvocationContext<CacheOperation> context, CacheResolver cacheResolver) { Collection<? extends Cache> caches = cacheResolver.resolveCaches(context); if (caches.isEmpty()) { throw new IllegalStateException("No cache could be resolved for '" + context.getOperation() + "' using resolver '" + cacheResolver + "'. At least one cache should be provided per cache operation."); } return caches; }
@Override public Collection<? extends Cache> resolveCaches(CacheOperationInvocationContext<?> context) { return this.cacheResolver.obtain().resolveCaches(context); } }
/** * Resolve the cache to use. * @param context the invocation context * @return the cache to use (never null) */ protected Cache resolveCache(CacheOperationInvocationContext<O> context) { Collection<? extends Cache> caches = context.getOperation().getCacheResolver().resolveCaches(context); Cache cache = extractFrom(caches); if (cache == null) { throw new IllegalStateException("Cache could not have been resolved for " + context.getOperation()); } return cache; }
@Nullable private Cache resolveExceptionCache(CacheOperationInvocationContext<CacheResultOperation> context) { CacheResolver exceptionCacheResolver = context.getOperation().getExceptionCacheResolver(); if (exceptionCacheResolver != null) { return extractFrom(context.getOperation().getExceptionCacheResolver().resolveCaches(context)); } return null; }
/** * Resolve the cache to use. * @param context the invocation context * @return the cache to use (never null) */ protected Cache resolveCache(CacheOperationInvocationContext<O> context) { Collection<? extends Cache> caches = context.getOperation().getCacheResolver().resolveCaches(context); Cache cache = extractFrom(caches); if (cache == null) { throw new IllegalStateException("Cache could not have been resolved for " + context.getOperation()); } return cache; }
@Nullable private Cache resolveExceptionCache(CacheOperationInvocationContext<CacheResultOperation> context) { CacheResolver exceptionCacheResolver = context.getOperation().getExceptionCacheResolver(); if (exceptionCacheResolver != null) { return extractFrom(context.getOperation().getExceptionCacheResolver().resolveCaches(context)); } return null; }
protected Collection<? extends Cache> getCaches( CacheOperationInvocationContext<CacheOperation> context, CacheResolver cacheResolver) { Collection<? extends Cache> caches = cacheResolver.resolveCaches(context); if (caches.isEmpty()) { throw new IllegalStateException("No cache could be resolved for '" + context.getOperation() + "' using resolver '" + cacheResolver + "'. At least one cache should be provided per cache operation."); } return caches; }
@Override public Collection<? extends Cache> resolveCaches(CacheOperationInvocationContext<?> context) { if (this.cacheResolver == null) { this.cacheResolver = new SimpleExceptionCacheResolver(getDefaultCacheManager()); } return this.cacheResolver.resolveCaches(context); } }
/** * Resolve the cache to use. * @param context the invocation context * @return the cache to use (never null) */ protected Cache resolveCache(CacheOperationInvocationContext<O> context) { Collection<? extends Cache> caches = context.getOperation().getCacheResolver().resolveCaches(context); Cache cache = extractFrom(caches); if (cache == null) { throw new IllegalStateException("Cache could not have been resolved for " + context.getOperation()); } return cache; }
private Cache resolveExceptionCache(CacheOperationInvocationContext<CacheResultOperation> context) { CacheResolver exceptionCacheResolver = context.getOperation().getExceptionCacheResolver(); if (exceptionCacheResolver != null) { return extractFrom(context.getOperation().getExceptionCacheResolver().resolveCaches(context)); } return null; }