Example usage for org.springframework.cache.interceptor CacheOperation getCacheNames

List of usage examples for org.springframework.cache.interceptor CacheOperation getCacheNames

Introduction

In this page you can find the example usage for org.springframework.cache.interceptor CacheOperation getCacheNames.

Prototype

@Override
    public Set<String> getCacheNames() 

Source Link

Usage

From source file:grails.plugin.cache.web.filter.PageFragmentCachingFilter.java

protected Collection<Cache> getCaches(CacheOperation operation) {
    Set<String> cacheNames = operation.getCacheNames();
    Collection<Cache> caches = new ArrayList<Cache>(cacheNames.size());
    for (String name : cacheNames) {
        Cache cache = getCacheManager().getCache(name);
        if (cache == null) {
            throw new IllegalArgumentException("Cannot find cache named [" + name + "] for " + operation);
        }//from  w  w  w  .j  ava 2s  .  c  o m
        caches.add(cache);
    }
    return caches;
}

From source file:org.springframework.cache.interceptor.YJFCacheAspectSupport.java

protected Collection<Cache> getCaches(CacheOperation operation) {
    Set<String> cacheNames = operation.getCacheNames();
    Collection<Cache> caches = new ArrayList<Cache>(cacheNames.size());
    for (String cacheName : cacheNames) {
        Cache cache = this.cacheManager.getCache(cacheName);
        if (cache == null) {
            throw new IllegalArgumentException("Cannot find cache named [" + cacheName + "] for " + operation);
        }/*from w  w  w .  j  av a 2 s .c om*/
        caches.add(cache);
    }
    return caches;
}