Codota Logo
IEngineConfiguration.getCacheManager
Code IndexAdd Codota to your IDE (free)

How to use
getCacheManager
method
in
org.thymeleaf.IEngineConfiguration

Best Java code snippets using org.thymeleaf.IEngineConfiguration.getCacheManager (Showing top 12 results out of 315)

  • Common ways to obtain IEngineConfiguration
private void myMethod () {
IEngineConfiguration i =
  • Codota IconITemplateContext context;context.getConfiguration()
  • Smart code suggestions by Codota
}
origin: thymeleaf/thymeleaf

/**
 * <p>
 *   Returns the cache manager in effect. This manager is in charge of providing
 *   the various caches needed by the system during its process.
 * </p>
 * <p>
 *   By default, an instance of {@link org.thymeleaf.cache.StandardCacheManager}
 *   is set.
 * </p>
 *
 * @return the cache manager
 */
public final ICacheManager getCacheManager() {
  if (this.initialized) {
    return this.configuration.getCacheManager();
  }
  return this.cacheManager;
}
origin: thymeleaf/thymeleaf

static <V> void removeFromCache(final IEngineConfiguration configuration, final String input, final String type) {
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    final ICache<ExpressionCacheKey,Object> cache = cacheManager.getExpressionCache();
    if (cache != null) {
      cache.clearKey(new ExpressionCacheKey(type,input));
    }
  }
}
origin: thymeleaf/thymeleaf

static <V> void putIntoCache(final IEngineConfiguration configuration, final String input, final V value, final String type) {
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    final ICache<ExpressionCacheKey,Object> cache = cacheManager.getExpressionCache();
    if (cache != null) {
      cache.put(new ExpressionCacheKey(type,input), value);
    }
  }
}
origin: thymeleaf/thymeleaf

static Object getFromCache(final IEngineConfiguration configuration, final String input, final String type) {
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    final ICache<ExpressionCacheKey,Object> cache = cacheManager.getExpressionCache();
    if (cache != null) {
      return cache.get(new ExpressionCacheKey(type,input));
    }
  }
  return null;
}
origin: thymeleaf/thymeleaf

  throws Exception {
final ICacheManager cacheManager = configuration.getCacheManager();
final ICache<ExpressionCacheKey, Object> expressionCache = (cacheManager == null? null : cacheManager.getExpressionCache());
origin: thymeleaf/thymeleaf

final ICacheManager cacheManager = configuration.getCacheManager();
final Set<ITemplateResolver> templateResolvers = configuration.getTemplateResolvers();
final Set<IMessageResolver> messageResolvers = configuration.getMessageResolvers();
origin: thymeleaf/thymeleaf

/**
 * <p>
 *   This constructor should only be called directly for <strong>testing purposes</strong>.
 * </p>
 *
 * @param configuration the engine configuration
 */
public TemplateManager(final IEngineConfiguration configuration) {
  
  super();
  Validate.notNull(configuration, "Configuration cannot be null");
  this.configuration = configuration;
  final ICacheManager cacheManager = this.configuration.getCacheManager();
  if (cacheManager == null) {
    this.templateCache = null;
  } else {
    this.templateCache = cacheManager.getTemplateCache();
  }
  final boolean standardDialectPresent = this.configuration.isStandardDialectPresent();
  // TODO Make these parser implementations configurable: one parser per template mode, then make default implementations extensible/configurable (e.g. AttoParser config)
  this.htmlParser = new HTMLTemplateParser(DEFAULT_PARSER_POOL_SIZE,DEFAULT_PARSER_BLOCK_SIZE);
  this.xmlParser = new XMLTemplateParser(DEFAULT_PARSER_POOL_SIZE, DEFAULT_PARSER_BLOCK_SIZE);
  this.textParser = new TextTemplateParser(DEFAULT_PARSER_POOL_SIZE, DEFAULT_PARSER_BLOCK_SIZE, standardDialectPresent);
  this.javascriptParser = new JavaScriptTemplateParser(DEFAULT_PARSER_POOL_SIZE, DEFAULT_PARSER_BLOCK_SIZE, standardDialectPresent);
  this.cssParser = new CSSTemplateParser(DEFAULT_PARSER_POOL_SIZE, DEFAULT_PARSER_BLOCK_SIZE, standardDialectPresent);
  this.rawParser = new RawTemplateParser(DEFAULT_PARSER_POOL_SIZE, DEFAULT_PARSER_BLOCK_SIZE);
}

origin: thymeleaf/thymeleaf-spring

private static ComputedSpelExpression getExpression(final IEngineConfiguration configuration, final String spelExpression) {
  ComputedSpelExpression exp = null;
  ICache<ExpressionCacheKey, Object> cache = null;
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    cache = cacheManager.getExpressionCache();
    if (cache != null) {
      exp = (ComputedSpelExpression) cache.get(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression));
    }
  }
  if (exp == null) {
    final SpelExpression spelExpressionObject = (SpelExpression) PARSER.parseExpression(spelExpression);
    final boolean mightNeedExpressionObjects = StandardExpressionUtils.mightNeedExpressionObjects(spelExpression);
    exp = new ComputedSpelExpression(spelExpressionObject, mightNeedExpressionObjects);
    if (cache != null && null != exp) {
      cache.put(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression), exp);
    }
  }
  return exp;
  
}
origin: org.thymeleaf/thymeleaf-spring3

private static ComputedSpelExpression getExpression(final IEngineConfiguration configuration, final String spelExpression) {
  ComputedSpelExpression exp = null;
  ICache<ExpressionCacheKey, Object> cache = null;
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    cache = cacheManager.getExpressionCache();
    if (cache != null) {
      exp = (ComputedSpelExpression) cache.get(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression));
    }
  }
  if (exp == null) {
    final SpelExpression spelExpressionObject = (SpelExpression) PARSER.parseExpression(spelExpression);
    final boolean mightNeedExpressionObjects = StandardExpressionUtils.mightNeedExpressionObjects(spelExpression);
    exp = new ComputedSpelExpression(spelExpressionObject, mightNeedExpressionObjects);
    if (cache != null && null != exp) {
      cache.put(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression), exp);
    }
  }
  return exp;
  
}
origin: thymeleaf/thymeleaf-spring

private static ComputedSpelExpression getExpression(final IEngineConfiguration configuration, final String spelExpression) {
  ComputedSpelExpression exp = null;
  ICache<ExpressionCacheKey, Object> cache = null;
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    cache = cacheManager.getExpressionCache();
    if (cache != null) {
      exp = (ComputedSpelExpression) cache.get(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression));
    }
  }
  if (exp == null) {
    // SELECT THE ADEQUATE SpEL EXPRESSION PARSER depending on whether SpEL compilation is enabled
    final SpelExpressionParser spelExpressionParser =
        PARSER_WITH_COMPILED_SPEL != null && SpringStandardExpressions.isSpringELCompilerEnabled(configuration)?
            PARSER_WITH_COMPILED_SPEL : PARSER_WITHOUT_COMPILED_SPEL;
    final SpelExpression spelExpressionObject = (SpelExpression) spelExpressionParser.parseExpression(spelExpression);
    final boolean mightNeedExpressionObjects = StandardExpressionUtils.mightNeedExpressionObjects(spelExpression);
    exp = new ComputedSpelExpression(spelExpressionObject, mightNeedExpressionObjects);
    if (cache != null && null != exp) {
      cache.put(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression), exp);
    }
  }
  return exp;
  
}
origin: thymeleaf/thymeleaf-spring

private static ComputedSpelExpression getExpression(final IEngineConfiguration configuration, final String spelExpression) {
  ComputedSpelExpression exp = null;
  ICache<ExpressionCacheKey, Object> cache = null;
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    cache = cacheManager.getExpressionCache();
    if (cache != null) {
      exp = (ComputedSpelExpression) cache.get(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression));
    }
  }
  if (exp == null) {
    // SELECT THE ADEQUATE SpEL EXPRESSION PARSER depending on whether SpEL compilation is enabled
    final SpelExpressionParser spelExpressionParser =
        PARSER_WITH_COMPILED_SPEL != null && SpringStandardExpressions.isSpringELCompilerEnabled(configuration)?
            PARSER_WITH_COMPILED_SPEL : PARSER_WITHOUT_COMPILED_SPEL;
    final SpelExpression spelExpressionObject = (SpelExpression) spelExpressionParser.parseExpression(spelExpression);
    final boolean mightNeedExpressionObjects = StandardExpressionUtils.mightNeedExpressionObjects(spelExpression);
    exp = new ComputedSpelExpression(spelExpressionObject, mightNeedExpressionObjects);
    if (cache != null && null != exp) {
      cache.put(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression), exp);
    }
  }
  return exp;
  
}
origin: org.thymeleaf/thymeleaf-spring4

private static ComputedSpelExpression getExpression(final IEngineConfiguration configuration, final String spelExpression) {
  ComputedSpelExpression exp = null;
  ICache<ExpressionCacheKey, Object> cache = null;
  final ICacheManager cacheManager = configuration.getCacheManager();
  if (cacheManager != null) {
    cache = cacheManager.getExpressionCache();
    if (cache != null) {
      exp = (ComputedSpelExpression) cache.get(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression));
    }
  }
  if (exp == null) {
    // SELECT THE ADEQUATE SpEL EXPRESSION PARSER depending on whether SpEL compilation is enabled
    final SpelExpressionParser spelExpressionParser =
        PARSER_WITH_COMPILED_SPEL != null && SpringStandardExpressions.isSpringELCompilerEnabled(configuration)?
            PARSER_WITH_COMPILED_SPEL : PARSER_WITHOUT_COMPILED_SPEL;
    final SpelExpression spelExpressionObject = (SpelExpression) spelExpressionParser.parseExpression(spelExpression);
    final boolean mightNeedExpressionObjects = StandardExpressionUtils.mightNeedExpressionObjects(spelExpression);
    exp = new ComputedSpelExpression(spelExpressionObject, mightNeedExpressionObjects);
    if (cache != null && null != exp) {
      cache.put(new ExpressionCacheKey(EXPRESSION_CACHE_TYPE_SPEL,spelExpression), exp);
    }
  }
  return exp;
  
}
org.thymeleafIEngineConfigurationgetCacheManager

Popular methods of IEngineConfiguration

  • getExecutionAttributes
  • getExpressionObjectFactory
  • getTemplateManager
  • getAttributeDefinitions
  • getCDATASectionProcessors
  • getCommentProcessors
  • getDecoupledTemplateLogicResolver
  • getDialectConfigurations
  • getDialects
  • getDocTypeProcessors
  • getElementDefinitions
  • getEngineContextFactory
  • getElementDefinitions,
  • getEngineContextFactory,
  • getLinkBuilders,
  • getMessageResolvers,
  • getModelFactory,
  • getPostProcessors,
  • getPreProcessors,
  • getProcessingInstructionProcessors,
  • getStandardDialectPrefix

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Reference (javax.naming)
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
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