Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Create a Google Guava Cache using a complex key
  2. CacheLoader<Pair<String, String>, String> loader =
  3.     new CacheLoader<Pair<String, String>, String>() {
  4.        public String load(Pair<String, String> key) {
  5.            return GetRatingIdentityByShortNameLoader(key.first, key.second);
  6.        }
  7.     };
  8.  
  9. _ratingIdCache = CacheBuilder.newBuilder()
  10.     .concurrencyLevel(a_conclevel.intValue())
  11.     .maximumSize(a_maxsize.intValue())
  12.     .expireAfterAccess(a_maxage.intValue(), TimeUnit.MINUTES)
  13.     .build(loader);
  14.        
  15. Cache<String, String> _ratingAgencyId;
  16.        
  17. Cache<Pair<String, String>, String> _ratingAgencyId;