Tabnine Logo
AbstractEHCacheProvider.cacheExists
Code IndexAdd Tabnine to your IDE (free)

How to use
cacheExists
method
in
org.dd4t.caching.providers.AbstractEHCacheProvider

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

origin: org.dd4t/dd4t-caching

/**
 * Store given item in the cache with a simple time-to-live property.
 *
 * @param key          String representing the key to store the payload under
 * @param cacheElement CacheElement a wrapper around the actual value to store in
 *                     cache
 */
@Override
public <T> void storeInItemCache(String key, CacheElement<T> cacheElement) {
  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);
  storeElement(key, cacheElement);
}
org.dd4t.caching.providersAbstractEHCacheProvidercacheExists

Popular methods of AbstractEHCacheProvider

  • isEnabled
  • storeElement
  • storeInItemCache

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JList (javax.swing)
  • 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