Tabnine Logo
EHCache3Provider.addNewDependencyCacheElement
Code IndexAdd Tabnine to your IDE (free)

How to use
addNewDependencyCacheElement
method
in
org.dd4t.caching.providers.EHCache3Provider

Best Java code snippets using org.dd4t.caching.providers.EHCache3Provider.addNewDependencyCacheElement (Showing top 1 results out of 315)

origin: org.dd4t/dd4t-caching

@Override
public void addDependency(final String cacheKey, final String dependencyKey) {
  if (!isEnabled()) {
    return;
  }
  if (!dependencyCacheExists()) {
    LOG.error("Cache configuration is invalid! NOT Caching. Check EH Cache configuration.");
    return;
  }
  LOG.debug("Add dependency from key: {} to key: {}", dependencyKey, cacheKey);
  if (dependencyCache.containsKey(dependencyKey)) {
    CacheElement<ConcurrentSkipListSet<String>> dependencyElement = dependencyCache.get(dependencyKey);
    if (dependencyElement != null && dependencyElement.getPayload() != null) {
      ConcurrentSkipListSet<String> cacheSet = dependencyElement.getPayload();
      if (!cacheSet.contains(cacheKey)) {
        LOG.info("Adding cachekey: {} to dependent key: {}", cacheKey, dependencyKey);
        cacheSet.add(cacheKey);
      }
      dependencyElement.setExpired(false);
      dependencyCache.replace(dependencyKey, dependencyElement);
    } else {
      addNewDependencyCacheElement(cacheKey, dependencyKey);
    }
  } else {
    addNewDependencyCacheElement(cacheKey, dependencyKey);
  }
  LOG.info("Added or replaced cache element with dependency key: {} and dependent key: {}", dependencyKey,
      cacheKey);
}
org.dd4t.caching.providersEHCache3ProvideraddNewDependencyCacheElement

Popular methods of EHCache3Provider

  • addDependency
  • cacheExists
  • dependencyCacheExists
  • doCheckForPreview
  • getKey
  • isEnabled

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
  • setRequestProperty (URLConnection)
  • Menu (java.awt)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top plugins for Android Studio
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