Package org.apache.sling.scripting.spi.bundle

# Interface BundledRenderUnitFinder

@ConsumerType public interface BundledRenderUnitFinder
The `BundledScriptFinder` finds the `BundledRenderUnit` corresponding to a certain chain of `TypeProvider`s or corresponding to a certain path-based `BundledRenderUnitCapability`.

## Method Summary

Modifier and Type
Method
Description
`@Nullable BundledRenderUnit`
`findUnit(@NotNull org.osgi.framework.BundleContext context, @NotNull Set<TypeProvider> inheritanceChain, @NotNull Set<TypeProvider> allRelatedProviders)`
Retrieves the best matching `BundledRenderUnit` for the provided `inheritanceChain`, by scanning all `TypeProvider` bundles for the class or script capable of providing a rendering for resource type chain.
`@Nullable BundledRenderUnit`
`findUnit(@NotNull org.osgi.framework.BundleContext context, @NotNull TypeProvider provider, @NotNull Set<TypeProvider> allRelatedProviders)`
Retrieves a path-based `BundledRenderUnit` from the passed `provider`.

## Method Details

### findUnit

@Nullable @Nullable BundledRenderUnit findUnit(@NotNull @NotNull org.osgi.framework.BundleContext context, @NotNull @NotNull Set<TypeProvider> inheritanceChain, @NotNull @NotNull Set<TypeProvider> allRelatedProviders)
Retrieves the best matching `BundledRenderUnit` for the provided `inheritanceChain`, by scanning all `TypeProvider` bundles for the class or script capable of providing a rendering for resource type chain.

Parameters:
  `context` - the bundle context to use.
  `inheritanceChain` - the resource type chain; the set is ordered from the most specific resource type to the most generic one
  `allRelatedProviders` - this is a super set, containing both the `inheritanceChain` but also all the required providers; a required provider is a provider that's needed by a `ResourceType` in order to delegate rendering to it, but it's not extended by the same `ResourceType`
Returns:
  a `BundledRenderUnit` if one was found, `null` otherwise

### findUnit

@Nullable @Nullable BundledRenderUnit findUnit(@NotNull @NotNull org.osgi.framework.BundleContext context, @NotNull @NotNull TypeProvider provider, @NotNull @NotNull Set<TypeProvider> allRelatedProviders)
Retrieves a path-based `BundledRenderUnit` from the passed `provider`.

Parameters:
  `context` - the bundle context to use.
  `provider` - the provider from which to retrieve the unit
  `allRelatedProviders` - this is a super set, containing both the providers connected through an inheritance relationship but also all the required providers; a required provider is a provider that's needed by a `ResourceType` in order to delegate rendering to it, but it's not extended by the same `ResourceType`
Returns:
  a `BundledRenderUnit` if one was found, `null` otherwise
See Also:
  - `BundledRenderUnitCapability.getPath()`