public class CachedScriptUrlTemplateScanner extends Object implements ScriptUrlTemplateScanner, org.springframework.context.ApplicationListener<SiteContextCreatedEvent>
ScriptUrlTemplateScanner decorator that caches the result of an actual scan, and also pre-caches
the URL templates on site context creation.| Modifier and Type | Field and Description |
|---|---|
protected ScriptUrlTemplateScanner |
actualScanner |
protected org.craftercms.core.util.cache.CacheTemplate |
cacheTemplate |
static String |
URL_TEMPLATES_CACHE_KEY_ELEM |
| Constructor and Description |
|---|
CachedScriptUrlTemplateScanner() |
| Modifier and Type | Method and Description |
|---|---|
void |
onApplicationEvent(SiteContextCreatedEvent event) |
List<org.springframework.web.util.UriTemplate> |
scan(SiteContext siteContext)
Scans the site context at a certain path to discover script URL templates.
|
void |
setActualScanner(ScriptUrlTemplateScanner actualScanner) |
void |
setCacheTemplate(org.craftercms.core.util.cache.CacheTemplate cacheTemplate) |
public static final String URL_TEMPLATES_CACHE_KEY_ELEM
protected org.craftercms.core.util.cache.CacheTemplate cacheTemplate
protected ScriptUrlTemplateScanner actualScanner
public void setCacheTemplate(org.craftercms.core.util.cache.CacheTemplate cacheTemplate)
public void setActualScanner(ScriptUrlTemplateScanner actualScanner)
public void onApplicationEvent(SiteContextCreatedEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<SiteContextCreatedEvent>public List<org.springframework.web.util.UriTemplate> scan(SiteContext siteContext)
ScriptUrlTemplateScannerscan in interface ScriptUrlTemplateScannersiteContext - the site context to scanCopyright © 2018 CrafterCMS. All rights reserved.