Codota Logo
CacheElement.setNull
Code IndexAdd Codota to your IDE (free)

How to use
setNull
method
in
org.dd4t.caching.CacheElement

Best Java code snippets using org.dd4t.caching.CacheElement.setNull (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
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);
}
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));
  }
}
origin: org.dd4t/dd4t-core

cacheElement.setNull(true);
cacheProvider.storeInItemCache(uri, cacheElement);
throw new ItemNotFoundException("Unable to find page by id " + uri);
origin: org.dd4t/dd4t-caching

@Override
public <T> void storeInItemCache(final String key, final CacheElement<T> cacheElement, final
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(true);
  }
  cacheElement.setExpired(false);
  if (cache.containsKey(key)) {
    cache.replace(key, cacheElement);
  } else {
    cache.put(key, cacheElement);
  }
  for (CacheDependency dep : dependencies) {
    String dependentKey = getKey(dep.getPublicationId(), dep.getItemId());
    cacheElement.setDependentKey(dependentKey);
    addDependency(key, dependentKey);
  }
}
origin: org.dd4t/dd4t-core

cacheElement.setNull(true);
cacheProvider.storeInItemCache(key, cacheElement, publicationId, componentId);
throw new ItemNotFoundException(String.format("Could not find DCP with componentURI: %s and " +
org.dd4t.cachingCacheElementsetNull

Popular methods of CacheElement

  • getPayload
  • isExpired
  • setExpired
  • setPayload
  • getDependentKey
  • isNull
  • setDependentKey

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now