Code example for Cache

Methods: invalidate

0
  public void batchSetPreferences(Iterator<Preference> preferences, int batchSize) throws IOException {
    delegate.batchSetPreferences(preferences, batchSize);
  } 
 
  private void invalidateCache(String label) {
    cache.invalidate(label);
    if (log.isInfoEnabled()) { 
      log.info("Invalidated cache for label {}", label);
    } 
  } 
 
  @Override 
  public void addCandidate(String label, long itemID) throws IOException {
    delegate.addCandidate(label, itemID);
    invalidateCache(label);
  } 
 
  @Override 
  public Iterable<String> batchAddCandidates(Iterator<Candidate> candidates, int batchSize) throws IOException {
    Iterable<String> modifiedLabels = delegate.batchAddCandidates(candidates, batchSize);