Examples of MruCacheStorage


Examples of freemarker.cache.MruCacheStorage

        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      config = new Configuration();
      config.setCacheStorage(new MruCacheStorage(32, 32));
      MultiTemplateLoader loader = new MultiTemplateLoader(loaders.toArray(new TemplateLoader[loaders.size()]));
      config.setTemplateLoader(loader);
      config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    }
View Full Code Here

Examples of freemarker.cache.MruCacheStorage

                        }
                    }
                    if (softSize == 0 && strongSize == 0) {
                        throw invalidSettingValueException(name, value);
                    }
                    setCacheStorage(new MruCacheStorage(strongSize, softSize));
                } else {
                    setCacheStorage((CacheStorage) _ObjectBuilderSettingEvaluator.eval(
                            value, CacheStorage.class, _SettingEvaluationEnvironment.getCurrent()));
                }
            } else if (TEMPLATE_UPDATE_DELAY_KEY.equals(name)) {
View Full Code Here

Examples of freemarker.cache.MruCacheStorage

                        }
                    }
                    if (softSize == 0 && strongSize == 0) {
                        throw invalidSettingValueException(key, value);
                    }
                    setCacheStorage(new MruCacheStorage(strongSize, softSize));
                } else {
                    setCacheStorage((CacheStorage) ClassUtil.forName(value)
                            .newInstance());
                }
            } else if (TEMPLATE_UPDATE_DELAY_KEY.equalsIgnoreCase(key)) {
View Full Code Here

Examples of freemarker.cache.MruCacheStorage

   
    try {
      loader = new FileTemplateLoader(new File(configs.getTemplatesPath()));
      cfg.setTemplateLoader(loader);
      if(configs.allowCaching())
        cfg.setCacheStorage(new MruCacheStorage(0, Integer.MAX_VALUE));
      else
        cfg.setCacheStorage(new MruCacheStorage(0, 0));
    } catch (IOException e) {
      throw new RuntimeException("Template path could not be found");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.