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 Details

    • URL_TEMPLATES_CACHE_KEY_ELEM

      public static final String URL_TEMPLATES_CACHE_KEY_ELEM
      See Also:
    • cacheTemplate

      protected org.craftercms.core.util.cache.CacheTemplate cacheTemplate
    • actualScanner

      protected ScriptUrlTemplateScanner actualScanner
  • Constructor Details

    • CachedScriptUrlTemplateScanner

      public CachedScriptUrlTemplateScanner()
  • Method Details

    • setCacheTemplate

      public void setCacheTemplate(org.craftercms.core.util.cache.CacheTemplate cacheTemplate)
    • setActualScanner

      public void setActualScanner(ScriptUrlTemplateScanner actualScanner)
    • onApplicationEvent

      public void onApplicationEvent(SiteContextInitializedEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<SiteContextInitializedEvent>
    • scan

      public List<org.springframework.web.util.UriTemplate> scan(SiteContext siteContext)
      Description copied from interface: ScriptUrlTemplateScanner
      Scans the site context at a certain path to discover script URL templates.
      Specified by:
      scan in interface ScriptUrlTemplateScanner
      Parameters:
      siteContext - the site context to scan
      Returns:
      the list of URL templates