Community
Participate
Working Groups
OSGi 4.4 will introduce the following interfaces in support of Subsystems (RFC 152) and OBR (RFC 112) requirements. Resource Capability Requirement Wire The latter three are simply generalizations of the existing BundleCapability, BundleRequirement, and BundleWire. Resource is a new concept that supports the Subsystems and OBR requirement of working with resources other than bundles. A Resource is not a runtime object like a Bundle. Rather, it is descriptive information about a resource similar to BundleRevision.
Created attachment 198155 [details] Work In Progress This patch is a work in progress. org.eclipse.osgi has been updated with the latest org.osgi.framework.wiring API and the corresponding implementation changes made. The changes boil down to the effects of the following. BundleWire extends Wire BundleCapability extends Capability BundleRequirement extends Requirement BundleRevision extends Resource So anything implementing the interfaces on the left had to be updated to support anything missing for the more general ones on the right. I neglected to mention in the description that another API change in progress is the addition of a new capability with a namespace of osgi.identity. The capability must be synthesized by the framework based on a bundle's symbolic name and version. The patch includes this new functionality within the StateBuilder whenever a BundleDescription is created. The patch also updates org.eclipse.equinox.region.tests to fix some compile errors resulting from the new interfaces. This patch does not pass all of the tests in org.eclipse.osgi.tests. I have investigated some of the issues and fixed some of the failures. So far, the issues have all been related to the tests and not the implementation, but there's more to do.
Created attachment 198209 [details] Work In Progress 2 Updated patch that includes some modified files under test_files/genericCapability and removes the .api_filter file changes.
Created attachment 198272 [details] updated work in progress This patch fixes all the tests to pass. I also changed the following: 1) Made the osgi.identity capability effective=resolve 2) Made it an error for a bundle to declare the osgi.identity capability in the Provide-Capability header.
At the CPEG F2F, it was decided that a fragment's osgi.identity capability should not be merged into the host like other capabilities. I believe that decision will affect this patch at both the implementation and test level.
Created attachment 198420 [details] updated work in progress (In reply to comment #4) > At the CPEG F2F, it was decided that a fragment's osgi.identity capability > should not be merged into the host like other capabilities. I believe that > decision will affect this patch at both the implementation and test level. Here is an updated patch that implements this behavior.
Created attachment 198779 [details] updated work in progress with new tests This patch adds some new tests focusing on resources and the identity capability. Failures are occurring in the following areas. (1) Merging an osgi.identity requirement within a fragment into its host. My understanding is although a fragment's identity capability is not merged into the host, identity requirements are treated like any other. (2) Returning the osgi.identity capability of a fragment as part of BundleWiring.getCapabilities(). (3) Returning the wire associated with the osgi.identity capability of a fragment as part of BundleWiring.getProvidedWires(). With regard to (2) and (3), the wire actually exists and can be retrieved from the requirer's BundleWiring. The parts of the test that are failing have been commented out and marked with a TODO.
Created attachment 198857 [details] proposed patch This updated patch fixes some test and implementation issues. All tests now pass. The test issues revolved around expecting a fragment's identity capability to be part of the host revision's capabilities, which is incorrect. A fragment's identity capability should be part of the host wiring's capabilities, however. Fixes to the framework impl were as follows. (1) BundleDescriptionImpl.DescriptionWiring.getCapabilities was changed to always return the selected generic capabilities for both bundles and fragments. Previously, it always returned an empty list for fragments which suppressed the fragment's identity capability. (2) BundleDescriptionImpl.BundleWireImpl.getProvider and getRequirer now return the wiring's provider and requirer revisions, respectively, instead of the capability and requirement revisions.
Created attachment 198921 [details] proposed patch This patch adds additional tests for generic requirement and capability matching. Also adds a fix to VersionConstraintImpl.BundleRequirementImpl.matches which now checks the namespace and accepts a null filter in the generic case.
Thanks for the work on this John. I am going to review this and plan to release. I first want to run through the OSGi CT and see where we break. I know we will break in some places because of the new osgi.identity capability we are adding.
Created attachment 199140 [details] latest patch This patch adds the arbitrary directives and attributes from the Bundle-SymbolicName header to the identity capability.
Created attachment 199146 [details] updated patch I updated the patch to move the test bundles out from the source folders. There was no need to use real source folders for the tests since there is no java code in them. The previous patches would have failed because the build.properties file was not modified to actually build these test bundles.
patch released.