Java Reference
In-Depth Information
Bundle A
Bundle B
Capabilities
Capabilities
fancyfoods.mandatory;
chocolate=nice;
cheese=yummy;
mandatory:="chocolate, cheese"
Requirements
fancyfoods.mandatory;
chocolate=nice
Requirements
unsatisfied
Figure 7.4 If a capability includes the mandatory directive, requirements must specify the mandatory
attributes to be satisfied. In this case, a bundle with a requirement for the fancyfoods.mandatory
package must also specify that chocolate is nice and cheese is yummy for bundle B to satisfy the re-
quirement.
though it's unlikely that you'll need to use it, we think it's important that you know
what it looks like and what it does, in case you see it in a bundle manifest somewhere.
The remaining directives are different from the resolution and mandatory direc-
tives in that they don't have a corresponding entry in a bundle manifest. On the other
hand, they're extremely useful!
THE CARDINALITY DIRECTIVE
The cardinality directive is simple to understand; it's applied to a requirement and
determines the number of capabilities that can be wired to that requirement by the
resolver. It has two values: single and multiple . The default value is single ; however,
the cardinality is determined by the interaction between the resolution directive and
the cardinality directive (see figure 7.5 and table 7.1).
Resource
Capabilities
Requirements
Resource
Capabilities
Resource
Capabilities
Requirements
Resource
Capabilities
Requirements
Requirements
required:=mandatory;
cardinality:=single
required:=optional;
cardinality:=single
Resource
Capabilities
Resource
Capabilities
Resource
Capabilities
Resource
Capabilities
Resource
Capabilities
Requirements
Resource
Capabilities
Resource
Capabilities
Requirements
Resource
Capabilities
Requirements
Requirements
Requirements
Requirements
Requirements
Requirements
required:=mandatory;
cardinality:=multiple
Figure 7.5 How many instances of a capability are resolved is determined by the combination of the
cardinality directive and the resolution directive.
required:=optional;
cardinality:=multiple
Search WWH ::




Custom Search