Community
Participate
Working Groups
For R5 the framework will convert the Bundle-RequiredExecutionEnvironment (BREE) header into a Require-Capability in the osgi.ee namespace using the following rules: Assuming the following general format for a BREE element value: BREE ::= N1 ['-' V] [ '/' N2 [ '-' V ] ] Where N1 and N2 contain no '-' or '/' and V can be parsed into a valid Version and if multiple versions are specified they are identical. For example: CDC-1.0/Foundation-1.0 OSGi/Minimum-1.2 Each BREE element gets converted into an equivalent osgi.ee Require-Capability filter with the following conversion: filter ::= '(&(osgi.ee=' E1 '/' E2 ') [ '(version=' V ')' ] ')' Where E1 and E2 are simply N1 and N2 respectively except for the special case where N1 or N2 are 'J2SE'. In that case the J2SE value becomes JavaSE. If the BREE element cannot be parsed into E1, E2 and V then the filter simply looks like this: filter ::= '(osgi.ee=' X ')' Where X is the BREE element as is. Here are some examples: CDC-1.0/Foundation-1.0 == (&(osgi.ee=CDC/Foundation)(version=1.0)) OSGi/Minimum-1.2 == (&(osgi.ee=OSGi/Minimum)(version=1.2)) J2SE-1.4 == (&(osgi.ee=JavaSE)(version=1.4)) JavaSE-1.6 == (&(osgi.ee=JavaSE)(version=1.6)) AA/BB-1.7 == (&(osgi.ee=AA/BB)(version=1.7)) V1-1.5/V2-1.6 == (osgi.ee=V1-1.5/V2-1.6) MyEE-junkVersion == (osgi.ee=MyEE-junkVersion) Each element of the BREE is or'ed together in the final osgi.ee filter, for example: Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0, OSGi/Minimum-1.2, J2SE-1.4, JavaSE-1.6, AA/BB-1.7, V1-1.5/V2-1.6, MyEE-junkVersion This is converted into the following Require-Capability: Require-Capability: osgi.ee; filter:="(| (&(osgi.ee=CDC/Foundation)(version=1.0)) (&(osgi.ee=OSGi/Minimum)(version=1.2)) (&(osgi.ee=JavaSE)(version=1.4)) (&(osgi.ee=JavaSE)(version=1.6)) (&(osgi.ee=AA/BB)(version=1.7)) (osgi.ee=V1-1.5/V2-1.6) (osgi.ee=MyEE-junkVersion) )" Every org.osgi.framework.resource.Resource representing a bundle which has a BREE header will have the converted osgi.ee requirement in the list returned by Resource.getRequirements(String) for the osgi.ee namespace. In cases where the bundle already has a requirement for the osgi.ee namespace no merging is done, the bundle will simply have an additional osgi.ee requirement added.
Going to look at doing this for M5.
I released a fix in the following commit: http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=1adfd1b247f8446241bd426923dacb428c59d539