This document describes the concepts behind bundle requirements definition and management.
Contents:
Every bundle can describe its own requirements for system resources, security permissions and runtime platforms. Different modules - resource manager, permission manager or platform manager can analyze and resolve these requirements.
ProSyst offers managers for all the three types of requirements:
Note: The use of permission requirements is reasonable only with releases of the mBS framework, compliant with Release 3 of the OSGi Service Platform specifications. With the current release of the mBS framework, which is compliant with Release 4 of the specifications, use local permissions for defining the maximum set of permission a bundle should have.
An XML file - a requirement XML - holds all managed requirements of a bundle including the ones for system resources. Therefore, different managers can use the information in it to allow or restrict the operation of the bundle.
Note: Describing permission requirements in a requirement XML is needed only if the target bundle is compliant with the OSGi Service Platform Specification Release 3. For Release 4 compliant bundles, this is not required - you are expected to describe required permissions (termed as local permisisons) in an OSGI-INF/permissions.perm file within the bundle JAR file, whose syntax is defined by the OSGi standard.
Following is the document type description (DTD) of the resource requirements section within the requirement XML:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Note: The bundle requirement XML parser expects that the XML file is in ASCII format. This violation of XML specification is in order to make things simpler as well as provide a quick and cheap parsing of the file. Included data does not require a more complicated encoding.
Tip: You can use the Bundle Requirement utility to examine the contents of requirement XMLs.
The location of this file within the bundle JAR is indicated in the manifest header Bundle-Requirements:
"Bundle-Requirements" := 1*(<location of xml file> +(;requirement=<type of requirement>))
where:
<location of xml file> is the location of the requirement
XML within the bundle JAR.<type of requirement> indicates the type of requirements
in the XML. It can be "resources", "permissions" and/or
"platforms".Note: You can have more than one requirement XML in a bundle JAR. For example, a bundle can provide separate XMLs for its permission and resource requirements and then use the requirements token in the Bundle-Requirements header to indicate the difference.