-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OSGi] Opting in to Service Loader Mediator #1568
Comments
fipro78
pushed a commit
to fipro78/eclipse-collections
that referenced
this issue
Mar 27, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
Mar 27, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
Mar 27, 2024
Switched back to Automatic-Module-Name to fix only one topic at a time
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
Apr 4, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
Apr 4, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
Apr 4, 2024
Hi, may I work on this issue? |
I have already provided a PR for this issue. Not sure what you want to do now. |
Oh ok, please let me know if you find out. |
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 23, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 23, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 23, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 23, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 23, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 24, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 24, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 24, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 24, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 24, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 27, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
May 27, 2024
fipro78
added a commit
to fipro78/eclipse-collections
that referenced
this issue
Jun 11, 2024
donraab
added a commit
that referenced
this issue
Jun 11, 2024
Adds Feature #1568 - [OSGi] Opting in to Service Loader Mediator
Saurabh-Daware
pushed a commit
to Saurabh-Daware/eclipse-collections
that referenced
this issue
Jun 14, 2024
Saurabh-Daware
pushed a commit
to Saurabh-Daware/eclipse-collections
that referenced
this issue
Jun 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The design of Eclipse Collections is to have the API and the implementation in separate bundles. Internally the Java ServiceLoader API is used. This means the API uses Services that are provided by the implementation. The ServiceLoader API by default only works if consumer and provider are using the same classloader. Therefore it does not work in an OSGi context.
To make Eclipse Collections work in an OSGi context like Eclipse, an additional artifact is created and published via p2 update site, which combines API and IMPL in a single bundle, which solves the ServiceLoader classloader issue.
For a while now it is possible to consume dependencies directly from Maven in an Eclipse Target Platform. Also there are OSGi projects that are not based on Eclipse, that might want to consume Eclipse Collections but can't use a p2 update site.
If you try to use Eclipse Collections API and Implementation from Maven in an OSGi project, you will see the following exception at runtime:
It is possible to use Eclipse Collections API and IMPL from Maven in an OSGi project, if the Service Loader Mediator is used. You then need to add for example SPI Fly to the runtime, which is the reference implementation of the Service Loader Mediator Specification.
To make it work, the API and the IMPL bundles need to be registered to be processed by the Service Loader Mediator. With the current setup this can only be done by setting system properties, e.g. the following setting in a .bndrun file:
To avoid additional configurations for the runtime, the bundles could also opting in by requiring the Service Loader Mediator in the manifest.
The API needs:
The IMPL needs:
The text was updated successfully, but these errors were encountered: