Class CachedScriptUrlTemplateScanner
java.lang.Object
org.craftercms.engine.scripting.impl.CachedScriptUrlTemplateScanner
- All Implemented Interfaces:
EventListener
,ScriptUrlTemplateScanner
,org.springframework.context.ApplicationListener<SiteContextInitializedEvent>
public class CachedScriptUrlTemplateScanner
extends Object
implements ScriptUrlTemplateScanner, org.springframework.context.ApplicationListener<SiteContextInitializedEvent>
ScriptUrlTemplateScanner
decorator that caches the result of an actual scan, and also pre-caches
the URL templates on site context creation.- Author:
- avasquez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ScriptUrlTemplateScanner
protected org.craftercms.core.util.cache.CacheTemplate
static final String
-
Constructor Summary
ConstructorsConstructorDescriptionCachedScriptUrlTemplateScanner
(org.craftercms.core.util.cache.CacheTemplate cacheTemplate, ScriptUrlTemplateScanner actualScanner) -
Method Summary
Modifier and TypeMethodDescriptionvoid
List
<org.springframework.web.util.UriTemplate> scan
(SiteContext siteContext) Scans the site context at a certain path to discover script URL templates.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
URL_TEMPLATES_CACHE_KEY_ELEM
- See Also:
-
cacheTemplate
protected org.craftercms.core.util.cache.CacheTemplate cacheTemplate -
actualScanner
-
-
Constructor Details
-
CachedScriptUrlTemplateScanner
public CachedScriptUrlTemplateScanner(org.craftercms.core.util.cache.CacheTemplate cacheTemplate, ScriptUrlTemplateScanner actualScanner)
-
-
Method Details
-
onApplicationEvent
- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<SiteContextInitializedEvent>
-
scan
Description copied from interface:ScriptUrlTemplateScanner
Scans the site context at a certain path to discover script URL templates.- Specified by:
scan
in interfaceScriptUrlTemplateScanner
- Parameters:
siteContext
- the site context to scan- Returns:
- the list of URL templates
-