Class ScriptDependencyResolver

java.lang.Object
org.apache.sling.scripting.sightly.impl.utils.ScriptDependencyResolver
All Implemented Interfaces:
EventListener, ExternalResourceChangeListener, ResourceChangeListener, org.osgi.framework.BundleListener

public class ScriptDependencyResolver extends Object implements ResourceChangeListener, ExternalResourceChangeListener, org.osgi.framework.BundleListener
  • Field Details

  • Constructor Details

    • ScriptDependencyResolver

      public ScriptDependencyResolver()
  • Method Details

    • resolveScript

      public Resource resolveScript(RenderContext renderContext, String scriptIdentifier)
      Resolves a script identifier to a resource
      Parameters:
      renderContext - the context
      scriptIdentifier - the script identifier
      Returns:
      the matching resource or null if the looked up resource does not exist
    • onChange

      public void onChange(@NotNull @NotNull List<ResourceChange> changes)
      Description copied from interface: ResourceChangeListener
      Report resource changes based on the filter properties of this listener.

      Note that resource changes for paths which are ancestors of the paths this listener was registered to may be reported through this method. This is due to limitations of certain resource providers to provide events on a more granular level (e.g. for deletion or movement of resources containing (potentially nested) child resources).

      Starting with version 1.2 of this API, an instance of ResoureChangeList is passed as the parameter to allow passing additional information.

      Specified by:
      onChange in interface ResourceChangeListener
      Parameters:
      changes - The changes list. This list is immutable.
    • bundleChanged

      public void bundleChanged(org.osgi.framework.BundleEvent event)
      Specified by:
      bundleChanged in interface org.osgi.framework.BundleListener