获取 @CacheName 注解配置的 cacheName，注解可配置在方法和类之上
2519
protected String getCacheName(Invocation inv) {
		CacheName cacheName = inv.getMethod().getAnnotation(CacheName.class);
		if (cacheName != null) {
			return cacheName.value();
		}
		
		cacheName = inv.getController().getClass().getAnnotation(CacheName.class);
		if (cacheName == null) {
			throw new RuntimeException("EvictInterceptor need CacheName annotation in controller.");
		}
		
		return cacheName.value();
	}
526061
private String getCachedETag(HttpHost host, String file) {
        Map<String, Object> cachedETags = readCachedETags();

        @SuppressWarnings("unchecked")
        Map<String, Object> hostMap =
                (Map<String, Object>)cachedETags.get(host.toURI());
        if (hostMap == null) {
            return null;
        }

        @SuppressWarnings("unchecked")
        Map<String, String> etagMap = (Map<String, String>)hostMap.get(file);
        if (etagMap == null) {
            return null;
        }

        return etagMap.get("ETag");
    }
992096
function (modNames, cache, ret) {
            var i,
                m,
                mod,
                modStatus,
                self = this,
                waitingModules = self.waitingModules;

            ret = ret || {};
            // 提高性能，不用每个模块都再次全部依赖计算
            // 做个缓存，每个模块对应的待动态加载模块
            cache = cache || {};

            for (i = 0; i < modNames.length; i++) {
                m = modNames[i];
                if (cache[m]) {
                    continue;
                }
                cache[m] = 1;
                mod = Utils.createModuleInfo(m);
                modStatus = mod.status;
                if (modStatus >= READY_TO_ATTACH) {
                    continue;
                }
                if (modStatus !== LOADED) {
                    if (!waitingModules.contains(m)) {
                        if (modStatus !== LOADING) {
                            mod.status = LOADING;
                            ret[m] = 1;
                        }
                        /*jshint loopfunc:true*/
                        mod.wait(function (mod) {
                            waitingModules.remove(mod.name);
                            // notify current loader instance
                            waitingModules.notifyAll();
                        });
                        waitingModules.add(m);
                    }
                }
                self.calculate(mod.getNormalizedRequires(), cache, ret);
            }

            return ret;
        }
111236
final Cache loadExternalCache(String classSimpleName) {
		ServiceLoader<Cache> cacheLoader = ServiceLoader.load(Cache.class, Para.getParaClassLoader());
		for (Cache cache : cacheLoader) {
			if (cache != null && classSimpleName.equalsIgnoreCase(cache.getClass().getSimpleName())) {
				return cache;
			}
		}
		return null;
	}
1141166
public void clearCache(String cacheName) {
        Cache cache = this.cacheManager.getCache(cacheName);
        if (null != cache && Status.STATUS_ALIVE.equals(cache.getStatus())) {
            cache.removeAll();
            logger.warn("finished removeAll for cache: " + cacheName);
        }
    }
278445
function cacheCall(method, key) {
    return methodCache.call(method, key)
        .catch((err) => {
        log_1.logger.error(`[${method}] Error:`, err);
        throw err; // throw after log to stop async chain
    })
        .then((result) => {
        (result)
            ? log_1.logger.debug(`[${method}] Success: ${JSON.stringify(result)}`)
            : log_1.logger.debug(`[${method}] Success`);
        return result;
    });
}
1285460
function __getSetCacheResults(o) {

  var self = this,
      storage = o.storage,
      cacheID = o.cacheID,
      cacheFilter = o.cacheFilter,
      method = o.method,
      args = o.args,
      callback = o.callback,
      timeout = o.timeout;

  // See if cache is available
  storage.get(cacheID, function(err, data) {
    
    if (err) {
      
      callback.call(self, err, null);
      
    } else {
      
      if ( data ) {
        
        // Object found in cache
        
        // Run callback with cached array
        var results = JSON.parse(data);
        if (app.debugLog) app.debug("Using cached data for " + cacheID);
        callback.apply(self, results);
        
      } else {
        
        // Cache new data
        
        self[method].apply(self, args.concat([function(err) {
          
          if (err) {
            
            callback.call(self, err, null);
            
          } else {
            
            // Get results array from arguments
            var results = slice.call(arguments, 0);
            
            // Run cache filter if available
            if (cacheFilter instanceof Function) {
              results = cacheFilter.apply(self, results);
            }
            
            // Set cache data
            storage.set(cacheID, JSON.stringify(results), function(err) {
              
              if (err) {
                
                callback.call(self, err, null);

              } else {
                
                // If timeout available, set expiration
                if (timeout && typeof timeout == 'number') {
                  
                  // Set cache expiration
                  storage.expire(cacheID, timeout, function(err) {
                    
                    if (err) callback.call(self, err, null);
                    
                    else {
                      
                      // Run callback with results array (after expiration set)
                      if (app.debugLog) app.debug(util.format("Cached new data for %s (expires in %d seconds)", cacheID, timeout));
                      callback.apply(self, results);
                      
                    }
                    
                  });
                  
                } else {
                  
                  // Run callback with results array
                  if (app.debugLog) app.debug("Cached new data for " + cacheID);
                  callback.apply(self, results);  
                  
                }
                
              }
            });
          }
        }]));
        
      }
    }
    
  });

}
1315236
private static ObjectName getObjectName(Cache<?, ?> cache, MBeanType type) {
    String cacheManagerName = sanitize(cache.getCacheManager().getURI().toString());
    String cacheName = sanitize(cache.getName());

    try {
      String name = String.format("javax.cache:type=Cache%s,CacheManager=%s,Cache=%s",
          type, cacheManagerName, cacheName);
      return new ObjectName(name);
    } catch (MalformedObjectNameException e) {
      String msg = String.format("Illegal ObjectName for cacheManager=[%s], cache=[%s]",
          cacheManagerName, cacheName);
      throw new CacheException(msg, e);
    }
  }
64350
public static void setMainCache(String cacheName) {
		if (StrKit.isBlank(cacheName))
			throw new IllegalArgumentException("cacheName can not be blank");
		cacheName = cacheName.trim();
		Cache cache = cacheMap.get(cacheName);
		if (cache == null)
			throw new IllegalArgumentException("the cache not exists: " + cacheName);
		
		Redis.mainCache = cache;
	}
1201781
protected String buildCacheName(Invocation inv, Controller controller) {
		CacheName cacheName = inv.getMethod().getAnnotation(CacheName.class);
		if (cacheName != null)
			return cacheName.value();
		cacheName = controller.getClass().getAnnotation(CacheName.class);
		return (cacheName != null) ? cacheName.value() : inv.getActionKey();
	}
339246
String computeCacheKey(Class cls, String methodName, String argpart) {
		String cachekey = keyMaker.getMd5(cls.getName() + "." + methodName);
		if (!argpart.isEmpty()) {
			cachekey += "_" + keyMaker.getMd5(argpart);
		}
		logger.debug("CACHEID : {}.{}_{} = {}", cls.getName(), methodName, argpart, cachekey);
		return cachekey;
	}
1008537
public static <K, V> Cache<K, V> createCache(String cacheName) {
		return createCache(cacheName, DEFAULT_TTL, DEFAULT_CLEANUP_INTERVAL/*, application, layer*/);
	}
481680
function (modNames, cache, ret) {
            var i,
                m,
                mod,
                modStatus,
                self = this,
                waitingModules = self.waitingModules,
                runtime = self.runtime;

            ret = ret || {};
            // 提高性能，不用每个模块都再次全部依赖计算
            // 做个缓存，每个模块对应的待动态加载模块
            cache = cache || {};

            for (i = 0; i < modNames.length; i++) {
                m = modNames[i];
                if (cache[m]) {
                    continue;
                }
                cache[m] = 1;
                mod = Utils.createModuleInfo(runtime, m);
                modStatus = mod.status;
                if (modStatus === ERROR || modStatus === ATTACHED) {
                    continue;
                }
                if (modStatus != LOADED) {
                    if (!waitingModules.contains(m)) {
                        if (modStatus != LOADING) {
                            mod.status = LOADING;
                            ret[m] = 1;
                        }
                        mod.wait(function (mod) {
                            waitingModules.remove(mod.getName());
                            // notify current loader instance
                            waitingModules.notifyAll();
                        });
                        waitingModules.add(m);
                    }
                }
                self.calculate(mod.getNormalizedRequires(), cache, ret);
            }

            return ret;
        }
1245927
public void update(String cacheName, Cache cache) {
        cacheManager.enableManagement(cacheName, cache.isManagementEnabled());
        updateStatistics(cacheName, cache);
    }
1028904
private void cacheNameInternal(INode inode) {
    // Name is cached only for files
    if (inode.isDirectory()) {
      return;
    }
    ByteArray name = new ByteArray(inode.getLocalNameBytes());
    name = nameCache.put(name);
    if (name != null) {
      inode.setLocalName(name.getBytes());
    }
  }
1275839
@Override
    public Set<String> getCacheNames() {
        Set<String> names = new HashSet<>(this.cm.getCacheNames());
        names.add(this.defaultCache);
        return names;
    }
448696
def _get_cache_filename(name, filename):
    """"""
    filename = os.path.abspath(filename)[1:]
    home_folder = os.path.expanduser('~')
    base_cache_dir = os.path.join(home_folder, '.git-lint', 'cache')

    return os.path.join(base_cache_dir, name, filename)