@ProviderType
public interface ContextAwareServiceResolver
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ContextAwareServiceResolver.ResolveAllResult<T extends ContextAwareService>
Result of the
resolveAll(Class, Adaptable) method. |
| Modifier and Type | Method and Description |
|---|---|
<T extends ContextAwareService> |
resolve(@NotNull Class<T> serviceClass,
@NotNull org.apache.sling.api.adapter.Adaptable adaptable)
Resolves the best-matching service implementation for the given resource context.
|
<T extends ContextAwareService> |
resolveAll(@NotNull Class<T> serviceClass,
@NotNull org.apache.sling.api.adapter.Adaptable adaptable)
Resolves all matching service implementations for the given resource context.
|
@Nullable <T extends ContextAwareService> T resolve(@NotNull @NotNull Class<T> serviceClass, @NotNull @NotNull org.apache.sling.api.adapter.Adaptable adaptable)
ContextAwareService) are considered as candidates.
If multiple candidates exist the implementation with the highest service ranking is returned.T - Service interface or classserviceClass - Service interface or classadaptable - Adaptable which is either a Resource or SlingHttpServletRequest.
A resource instance is used directly for matching, in case of request the associated resource is used.
May be null if no context is available.@NotNull <T extends ContextAwareService> @NotNull ContextAwareServiceResolver.ResolveAllResult<T> resolveAll(@NotNull @NotNull Class<T> serviceClass, @NotNull @NotNull org.apache.sling.api.adapter.Adaptable adaptable)
ContextAwareService) are considered as candidates.
The candidates are returned ordered descending by their service ranking.T - Service interface or classserviceClass - Service interface or classadaptable - Adaptable which is either a Resource or SlingHttpServletRequest.
A resource instance is used directly for matching, in case of request the associated resource is used.
May be null if no context is available.Copyright © 2014–2019 wcm.io. All rights reserved.