Class ScriptCacheImpl

  • All Implemented Interfaces:
    org.apache.sling.api.resource.observation.ExternalResourceChangeListener, org.apache.sling.api.resource.observation.ResourceChangeListener, org.apache.sling.scripting.api.ScriptCache, org.osgi.service.event.EventHandler

    public class ScriptCacheImpl
    extends java.lang.Object
    implements org.apache.sling.scripting.api.ScriptCache, org.apache.sling.api.resource.observation.ResourceChangeListener, org.apache.sling.api.resource.observation.ExternalResourceChangeListener, org.osgi.service.event.EventHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_CACHE_SIZE  
      • Fields inherited from interface org.apache.sling.api.resource.observation.ResourceChangeListener

        CHANGES, PATHS, PROPERTY_NAMES_HINT
    • Constructor Summary

      Constructors 
      Constructor Description
      ScriptCacheImpl()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void activate​(org.apache.sling.scripting.core.impl.ScriptCacheImplConfiguration configuration, org.osgi.framework.BundleContext bundleCtx)  
      void clear()  
      protected void deactivate()  
      protected java.util.Set<java.lang.String> getCachedScripts()  
      org.apache.sling.scripting.api.CachedScript getScript​(java.lang.String scriptPath)  
      void handleEvent​(org.osgi.service.event.Event event)  
      void onChange​(@NotNull java.util.List<org.apache.sling.api.resource.observation.ResourceChange> list)  
      void putScript​(org.apache.sling.scripting.api.CachedScript script)  
      boolean removeScript​(java.lang.String scriptPath)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScriptCacheImpl

        public ScriptCacheImpl()
    • Method Detail

      • getScript

        public org.apache.sling.scripting.api.CachedScript getScript​(java.lang.String scriptPath)
        Specified by:
        getScript in interface org.apache.sling.scripting.api.ScriptCache
      • putScript

        public void putScript​(org.apache.sling.scripting.api.CachedScript script)
        Specified by:
        putScript in interface org.apache.sling.scripting.api.ScriptCache
      • clear

        public void clear()
        Specified by:
        clear in interface org.apache.sling.scripting.api.ScriptCache
      • removeScript

        public boolean removeScript​(java.lang.String scriptPath)
        Specified by:
        removeScript in interface org.apache.sling.scripting.api.ScriptCache
      • onChange

        public void onChange​(@NotNull
                             @NotNull java.util.List<org.apache.sling.api.resource.observation.ResourceChange> list)
        Specified by:
        onChange in interface org.apache.sling.api.resource.observation.ResourceChangeListener
      • getCachedScripts

        protected java.util.Set<java.lang.String> getCachedScripts()
      • activate

        protected void activate​(org.apache.sling.scripting.core.impl.ScriptCacheImplConfiguration configuration,
                                org.osgi.framework.BundleContext bundleCtx)
      • deactivate

        protected void deactivate()
      • handleEvent

        public void handleEvent​(org.osgi.service.event.Event event)
        Specified by:
        handleEvent in interface org.osgi.service.event.EventHandler