All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.blossomproject.core.cache.BlossomCacheResolver Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
package com.blossomproject.core.cache;

import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Collection;
import org.springframework.cache.CacheManager;
import org.springframework.cache.interceptor.AbstractCacheResolver;
import org.springframework.cache.interceptor.CacheOperationInvocationContext;

/**
 * Created by maelg on 12/05/2017.
 */
public class BlossomCacheResolver extends AbstractCacheResolver {

  public BlossomCacheResolver(CacheManager cacheManager) {
    super(cacheManager);
    Preconditions.checkNotNull(cacheManager);
  }

  @Override
  protected Collection getCacheNames(CacheOperationInvocationContext context) {
    if (context.getOperation().getCacheNames().isEmpty()) {
      return Lists.newArrayList(context.getTarget().getClass().getCanonicalName());
    }
    return context.getOperation().getCacheNames();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy