Package org.apache.sling.scripting.sightly.engine

# Interface BundledUnitManager

All Known Implementing Classes:
  `BundledUnitManagerImpl`

@ProviderType public interface BundledUnitManager

## Method Summary

Modifier and Type
Method
Description
`@Nullable ClassLoader`
`getBundledRenderUnitClassloader(Bindings bindings)`
Given a `Bindings` map, this method will check if the `bindings` contain a value for the `BundledRenderUnit.VARIABLE` property and if the object provided by `BundledRenderUnit.getUnit()` is an instance of a `RenderUnit`.
`URL`
`getScript(Bindings bindings, String identifier)`
Given a `Bindings` map, this method will check if the `bindings` contain a value for the `BundledRenderUnit.VARIABLE` property and, if a `BundledRenderUnit` is found, attempt to return the URL of dependency that the `BundledRenderUnit` needs to load.

## Method Details

### getBundledRenderUnitClassloader

@Nullable @Nullable ClassLoader getBundledRenderUnitClassloader(Bindings bindings)

Given a `Bindings` map, this method will check if the `bindings` contain a value for the `BundledRenderUnit.VARIABLE` property and if the object provided by `BundledRenderUnit.getUnit()` is an instance of a `RenderUnit`. If so, this service will return the `ClassLoader` of the `Bundle` providing the `BundledRenderUnit`.

Parameters:
  `bindings` - the bindings passed initially to the HTL Script Engine
Returns:
  the `BundledRenderUnit`'s classloader if one is found, `null` otherwise

### getScript

URL getScript(Bindings bindings, String identifier)
Given a `Bindings` map, this method will check if the `bindings` contain a value for the `BundledRenderUnit.VARIABLE` property and, if a `BundledRenderUnit` is found, attempt to return the URL of dependency that the `BundledRenderUnit` needs to load. This will take into account the bundle wirings of the unit's providing bundle (see `BundledRenderUnit.getBundle()`).

Parameters:
  `bindings` - the bindings passed initially to the HTL Script Engine
  `identifier` - the identifier of the dependency that a `BundledRenderUnit` from the `Bindings` needs to load
Returns:
  the URL of the `identifier` dependency, if one was found