Code example for Cache

Methods: invalidate

0
    cache.invalidateAll(); 
  } 
 
  @Override 
  public void evict(TemplateSource source) { 
    cache.invalidate(new TemplateKey(source, reloadable)); 
  } 
 
  @Override 
  public Template get(final TemplateSource source, final Parser parser) throws IOException { 
    try { 
      TemplateKey key = new TemplateKey(source, reloadable); 
      return cache.get(key, () -> parser.parse(source)); 
    } catch (ExecutionException e) { 
      throw new IOException("Can't parse " + source, e); 
    } 
  } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE