Tabnine Logo
EHCacheProvider.getKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getKey
method
in
org.dd4t.caching.providers.EHCacheProvider

Best Java code snippets using org.dd4t.caching.providers.EHCacheProvider.getKey (Showing top 2 results out of 315)

origin: org.dd4t/dd4t-caching

@Override
public void invalidate(final String key) {
  if (!isEnabled()) {
    return;
  }
  if (dependencyCache == null) {
    LOG.error("Cache configuration is invalid! NOT Caching. Check EH Cache configuration.");
    return;
  }
  String dependencyKey = getKey(key);
  Element dependencyElement = dependencyCache.get(dependencyKey);
  if (dependencyElement != null) {
    LOG.info("Expire key: {} from dependency cache", dependencyKey);
    setExpired(dependencyElement, ADJUST_TTL);
    ConcurrentSkipListSet<String> cacheSet = ((CacheElement<ConcurrentSkipListSet<String>>) dependencyElement
        .getObjectValue()).getPayload();
    if (cacheSet != null) {
      for (String cacheKey : cacheSet) {
        LOG.debug("Expire cache key: {} from cache", cacheKey);
        Element cacheElement = cache.get(cacheKey);
        setExpired(cacheElement, 0);
      }
    }
  } else {
    LOG.info("Attempting to expire key {} but not found in dependency cache", dependencyKey);
  }
}
origin: org.dd4t/dd4t-caching

@Override
public <T> void storeInItemCache(String key, CacheElement<T> cacheElement, List<CacheDependency> dependencies) {
  if (!isEnabled()) {
    return;
  }
  if (!cacheExists()) {
    LOG.error("Cache configuration is invalid! NOT Caching. Check EH Cache configuration.");
    return;
  }
  // detect undeclared nulls, complain, and set to null
  if (!cacheElement.isNull() && cacheElement.getPayload() == null) {
    Exception exToLogToHaveStacktraceWhoCausedIt = new Exception();
    LOG.error("Detected undeclared null payload on element with key " + key + " at insert time!",
        exToLogToHaveStacktraceWhoCausedIt);
    cacheElement.setNull(true);
  }
  cacheElement.setExpired(false);
  Element element = cache.get(key);
  if (element == null) {
    element = new Element(key, cacheElement);
  }
  cache.put(element);
  element.setTimeToLive(cacheDependencyTTL);
  for (CacheDependency dep : dependencies) {
    String dependentKey = getKey(dep.getPublicationId(), dep.getItemId());
    cacheElement.setDependentKey(dependentKey);
    addDependency(key, dependentKey);
    updateTTL(dependencyCache.get(dependentKey));
  }
}
org.dd4t.caching.providersEHCacheProvidergetKey

Popular methods of EHCacheProvider

  • addDependency
  • cacheExists
  • doCheckForPreview
  • expireElement
  • isEnabled
  • setExpired
  • setNotExpired
  • updateTTL

Popular in Java

  • Updating database using SQL prepared statement
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Collectors (java.util.stream)
  • JButton (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • 21 Best Atom Packages for 2021
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