Class BundleRenderUnitFinderImpl
java.lang.Object
org.apache.sling.scripting.core.impl.bundled.BundleRenderUnitFinderImpl
- All Implemented Interfaces:
EventListener
,BundledRenderUnitFinder
,org.osgi.framework.BundleListener
public class BundleRenderUnitFinderImpl
extends Object
implements BundledRenderUnitFinder, org.osgi.framework.BundleListener
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bundleChanged
(org.osgi.framework.BundleEvent event) @Nullable BundledRenderUnit
findUnit
(@NotNull org.osgi.framework.BundleContext context, @NotNull Set<TypeProvider> providers, @NotNull Set<TypeProvider> allProviders) Retrieves the best matchingBundledRenderUnit
for the providedinheritanceChain
, by scanning allTypeProvider
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> providers) Retrieves a path-basedBundledRenderUnit
from the passedprovider
.
-
Constructor Details
-
BundleRenderUnitFinderImpl
public BundleRenderUnitFinderImpl()
-
-
Method Details
-
findUnit
@Nullable public @Nullable BundledRenderUnit findUnit(@NotNull @NotNull org.osgi.framework.BundleContext context, @NotNull @NotNull Set<TypeProvider> providers, @NotNull @NotNull Set<TypeProvider> allProviders) Description copied from interface:BundledRenderUnitFinder
Retrieves the best matchingBundledRenderUnit
for the providedinheritanceChain
, by scanning allTypeProvider
bundles for the class or script capable of providing a rendering for resource type chain.- Specified by:
findUnit
in interfaceBundledRenderUnitFinder
- Parameters:
context
- the bundle context to use.providers
- the resource type chain; the set is ordered from the most specific resource type to the most generic oneallProviders
- this is a super set, containing both theinheritanceChain
but also all the required providers; a required provider is a provider that's needed by aResourceType
in order to delegate rendering to it, but it's not extended by the sameResourceType
- Returns:
- a
BundledRenderUnit
if one was found,null
otherwise
-
findUnit
@Nullable public @Nullable BundledRenderUnit findUnit(@NotNull @NotNull org.osgi.framework.BundleContext context, @NotNull @NotNull TypeProvider provider, @NotNull @NotNull Set<TypeProvider> providers) Description copied from interface:BundledRenderUnitFinder
Retrieves a path-basedBundledRenderUnit
from the passedprovider
.- Specified by:
findUnit
in interfaceBundledRenderUnitFinder
- Parameters:
context
- the bundle context to use.provider
- the provider from which to retrieve the unitproviders
- 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 aResourceType
in order to delegate rendering to it, but it's not extended by the sameResourceType
- Returns:
- a
BundledRenderUnit
if one was found,null
otherwise - See Also:
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event) - Specified by:
bundleChanged
in interfaceorg.osgi.framework.BundleListener
-