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
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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