@ProviderType
public interface Resolver
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<Resource,java.util.List<Wire>> |
resolve(ResolveContext context)
Resolve the specified resolve context and return any new resources and
wires to the caller.
|
java.util.Map<Resource,java.util.List<Wire>> |
resolveDynamic(ResolveContext context,
Wiring hostWiring,
Requirement dynamicRequirement)
Resolves a given requirement dynamically for the given host wiring using
the given resolve context and return any new resources and wires to the
caller.
|
java.util.Map<Resource,java.util.List<Wire>> resolve(ResolveContext context) throws ResolutionException
The resolver considers two groups of resources:
mandatory group must be
resolved. A failure to satisfy any mandatory requirement for these
resources will result in throwing a ResolutionExceptionoptional group may be
resolved. A failure to satisfy a mandatory requirement for a resource in
this group will not fail the overall resolution but no resources or wires
will be returned for that resource.
The resolve method returns the delta between the start state defined by
ResolveContext.getWirings() and the end resolved state. That is,
only new resources and wires are included.
The behavior of the resolver is not defined if the specified resolve context supplies inconsistent information.
context - The resolve context for the resolve operation. Must not be
null.ResolutionException - If the resolution cannot be satisfied.java.util.Map<Resource,java.util.List<Wire>> resolveDynamic(ResolveContext context, Wiring hostWiring, Requirement dynamicRequirement) throws ResolutionException
The requirement must be a requirement of the wiring and must use the
package namespace with a
resolution of type
dynamic.
The resolve context is not asked for
mandatory resources or for
optional resources. The
resolve context is asked to
find providers for the
given requirement. The matching package capabilities returned by the resolve context must not have a
osgi.wiring.package attribute
equal to a package capability
already wired to by the
wiring or equal a package
capability provided by the
wiring. The resolve context may be requested to
find providers for
other requirements in order to resolve the resources that provide the
matching capabilities to the given requirement.
If the requirement cardinality is not multiple then
no new wire must be created if the
wires of the wiring
already contain a wire that uses the requirement
This operation may resolve additional resources in order to resolve the
dynamic requirement. The returned map will contain entries for each
resource that got resolved in addition to the specified wiring
resource. The wire list for the wiring
resource will only contain one wire which is for the dynamic requirement.
context - The resolve context for the resolve operation. Must not be
null.hostWiring - The wiring with the dynamic
requirement.
Must not be null.dynamicRequirement - The dynamic requirement. Must not be
null.ResolutionException - if the dynamic requirement cannot be resolvedCopyright © OSGi Alliance (2000, 2020). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0