/** * Sets the time in milliseconds that must elapse before checking whether there is a newer version of a template * "file" than the cached one. Defaults to 5000 ms. * * <p> * When you get a template via {@link #getTemplate(String)} (or some of its overloads). FreeMarker will try to get * the template from the template cache. If the template is found, and at least this amount of time was elapsed * since the template last modification date was checked, FreeMarker will re-check the last modification date (this * could mean I/O), possibly reloading the template and updating the cache as a consequence (can mean even more * I/O). The {@link #getTemplate(String)} (or some of its overloads) call will only return after this all is * done, so it will return the fresh template. * * @since 2.3.23 */ public void setTemplateUpdateDelayMilliseconds(long millis) { cache.setDelay(millis); }
/** * Sets the time in seconds that must elapse before checking whether there is a newer version of a template "file" * than the cached one. * * <p> * Historical note: Despite what the API documentation said earlier, this method is <em>not</em> thread-safe. While * it works well on most hardware, it's not guaranteed that FreeMarker will see the update in all threads, and * theoretically it's also possible that it will see a value that's a binary mixture of the new and the old one. * * @deprecated Use {@link #setTemplateUpdateDelayMilliseconds(long)} instead, because the time granularity of this method * is often misunderstood to be milliseconds. */ @Deprecated public void setTemplateUpdateDelay(int seconds) { cache.setDelay(1000L * seconds); }
private void recreateTemplateCacheWith( TemplateLoader loader, CacheStorage storage, TemplateLookupStrategy templateLookupStrategy, TemplateNameFormat templateNameFormat, TemplateConfigurationFactory templateConfigurations) { TemplateCache oldCache = cache; cache = new TemplateCache( loader, storage, templateLookupStrategy, templateNameFormat, templateConfigurations, this); cache.clear(); // for fully BC behavior cache.setDelay(oldCache.getDelay()); cache.setLocalizedLookup(localizedLookup); }
private void createTemplateCache() { cache = new TemplateCache( getDefaultTemplateLoader(), getDefaultCacheStorage(), getDefaultTemplateLookupStrategy(), getDefaultTemplateNameFormat(), null, this); cache.clear(); // for fully BC behavior cache.setDelay(5000); }
/** * Set the time in seconds that must elapse before checking whether there is a newer * version of a template file. * This method is thread-safe and can be called while the engine works. */ public void setTemplateUpdateDelay(int delay) { cache.setDelay(1000L * delay); }
/** * Sets the time in milliseconds that must elapse before checking whether there is a newer version of a template * "file" than the cached one. Defaults to 5000 ms. * * <p> * When you get a template via {@link #getTemplate(String)} (or some of its overloads). FreeMarker will try to get * the template from the template cache. If the template is found, and at least this amount of time was elapsed * since the template last modification date was checked, FreeMarker will re-check the last modification date (this * could mean I/O), possibly reloading the template and updating the cache as a consequence (can mean even more * I/O). The {@link #getTemplate(String)} (or some of its overloads) call will only return after this all is * done, so it will return the fresh template. * * @since 2.3.23 */ public void setTemplateUpdateDelayMilliseconds(long millis) { cache.setDelay(millis); }
/** * Sets the time in milliseconds that must elapse before checking whether there is a newer version of a template * "file" than the cached one. Defaults to 5000 ms. * * <p> * When you get a template via {@link #getTemplate(String)} (or some of its overloads). FreeMarker will try to get * the template from the template cache. If the template is found, and at least this amount of time was elapsed * since the template last modification date was checked, FreeMarker will re-check the last modification date (this * could mean I/O), possibly reloading the template and updating the cache as a consequence (can mean even more * I/O). The {@link #getTemplate(String)} (or some of its overloads) call will only return after this all is * done, so it will return the fresh template. * * @since 2.3.23 */ public void setTemplateUpdateDelayMilliseconds(long millis) { cache.setDelay(millis); }
/** * Sets the time in seconds that must elapse before checking whether there is a newer version of a template "file" * than the cached one. * * <p> * Historical note: Despite what the API documentation said earlier, this method is <em>not</em> thread-safe. While * it works well on most hardware, it's not guaranteed that FreeMarker will see the update in all threads, and * theoretically it's also possible that it will see a value that's a binary mixture of the new and the old one. * * @deprecated Use {@link #setTemplateUpdateDelayMilliseconds(long)} instead, because the time granularity of this method * is often misunderstood to be milliseconds. */ @Deprecated public void setTemplateUpdateDelay(int seconds) { cache.setDelay(1000L * seconds); }
/** * Sets the time in seconds that must elapse before checking whether there is a newer version of a template "file" * than the cached one. * * <p> * Historical note: Despite what the API documentation said earlier, this method is <em>not</em> thread-safe. While * it works well on most hardware, it's not guaranteed that FreeMarker will see the update in all threads, and * theoretically it's also possible that it will see a value that's a binary mixture of the new and the old one. * * @deprecated Use {@link #setTemplateUpdateDelayMilliseconds(long)} instead, because the time granularity of this method * is often misunderstood to be milliseconds. */ @Deprecated public void setTemplateUpdateDelay(int seconds) { cache.setDelay(1000L * seconds); }
public Configuration() { cache = new TemplateCache(); cache.setConfiguration(this); cache.setDelay(5000); loadBuiltInSharedVariables(); }
private void recreateTemplateCacheWith( TemplateLoader loader, CacheStorage storage, TemplateLookupStrategy templateLookupStrategy, TemplateNameFormat templateNameFormat, TemplateConfigurationFactory templateConfigurations) { TemplateCache oldCache = cache; cache = new TemplateCache( loader, storage, templateLookupStrategy, templateNameFormat, templateConfigurations, this); cache.clear(); // for fully BC behavior cache.setDelay(oldCache.getDelay()); cache.setLocalizedLookup(localizedLookup); }
private void createTemplateCache(TemplateLoader loader, CacheStorage storage) { TemplateCache oldCache = cache; cache = new TemplateCache(loader, storage); cache.setDelay(oldCache.getDelay()); cache.setConfiguration(this); cache.setLocalizedLookup(localizedLookup); } /**
private void recreateTemplateCacheWith( TemplateLoader loader, CacheStorage storage, TemplateLookupStrategy templateLookupStrategy, TemplateNameFormat templateNameFormat, TemplateConfigurationFactory templateConfigurations) { TemplateCache oldCache = cache; cache = new TemplateCache( loader, storage, templateLookupStrategy, templateNameFormat, templateConfigurations, this); cache.clear(); // for fully BC behavior cache.setDelay(oldCache.getDelay()); cache.setLocalizedLookup(localizedLookup); }
private void createTemplateCache() { cache = new TemplateCache( getDefaultTemplateLoader(), getDefaultCacheStorage(), getDefaultTemplateLookupStrategy(), getDefaultTemplateNameFormat(), null, this); cache.clear(); // for fully BC behavior cache.setDelay(5000); }
private void createTemplateCache() { cache = new TemplateCache( getDefaultTemplateLoader(), getDefaultCacheStorage(), getDefaultTemplateLookupStrategy(), getDefaultTemplateNameFormat(), null, this); cache.clear(); // for fully BC behavior cache.setDelay(5000); }