Tabnine Logo
CacheHandle.invalidateAll
Code IndexAdd Tabnine to your IDE (free)

How to use
invalidateAll
method
in
com.bazaarvoice.emodb.cachemgr.api.CacheHandle

Best Java code snippets using com.bazaarvoice.emodb.cachemgr.api.CacheHandle.invalidateAll (Showing top 3 results out of 315)

origin: bazaarvoice/emodb

@Override
public void invalidateAll() {
  if(_cacheRegistry != null) {
    for(String name : _allAvailableCaches.keySet()) {
      // There is a potential race condition here since the cache is added to _allAvailableCaches
      // then subsequently added to _cacheRegistry in createCache(), making it possible for a value to
      // be cached but not invalidated on this call.  However, to avoid this issue all caches used by
      // this manager are pre-created in ApiKeyRealm.onInit(), so in practice this can never happen.
      CacheHandle cacheHandle = _cacheRegistry.lookup(name, false);
      cacheHandle.invalidateAll(InvalidationScope.GLOBAL);
    }
  } else {
    for(GuavaCache cache : _allAvailableCaches.values()) {
      cache.clear();
    }
  }
}
origin: com.bazaarvoice.emodb/emodb-cachemgr

  @Override
  public void execute(ImmutableMultimap<String, String> parameters, PrintWriter out) {
    String name = checkNotNull(Iterables.getFirst(parameters.get("cache"), null), "cache");
    String scopeString = Iterables.getFirst(parameters.get("scope"), "LOCAL");
    InvalidationScope scope = InvalidationScope.valueOf(scopeString.toUpperCase());
    Collection<String> keys = parameters.get("key");
    boolean invalidateAll = keys.isEmpty();

    CacheHandle handle = _registry.lookup(name, false);
    if (handle == null) {
      out.println("Cache not found: " + name);
      return;
    }

    if (invalidateAll) {
      handle.invalidateAll(scope);
    } else {
      handle.invalidateAll(scope, keys);
    }

    out.println("Done!");
  }
}
origin: bazaarvoice/emodb

  @Override
  public void execute(ImmutableMultimap<String, String> parameters, PrintWriter out) {
    String name = checkNotNull(Iterables.getFirst(parameters.get("cache"), null), "cache");
    String scopeString = Iterables.getFirst(parameters.get("scope"), "LOCAL");
    InvalidationScope scope = InvalidationScope.valueOf(scopeString.toUpperCase());
    Collection<String> keys = parameters.get("key");
    boolean invalidateAll = keys.isEmpty();

    CacheHandle handle = _registry.lookup(name, false);
    if (handle == null) {
      out.println("Cache not found: " + name);
      return;
    }

    if (invalidateAll) {
      handle.invalidateAll(scope);
    } else {
      handle.invalidateAll(scope, keys);
    }

    out.println("Done!");
  }
}
com.bazaarvoice.emodb.cachemgr.apiCacheHandleinvalidateAll

Popular methods of CacheHandle

  • invalidate
  • matches

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • setScale (BigDecimal)
  • getSharedPreferences (Context)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Notification (javax.management)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now