Skip to content
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

Derive serviceloader capabilities and requirements from hand-crafted services files #5903

Closed
HannesWell opened this issue Nov 25, 2023 · 4 comments · Fixed by #5912
Closed

Comments

@HannesWell
Copy link
Contributor

BND can derive the OSGi requirements and capabilities necessary for the OSGi service loader mediator specification leveraging BND's @Provider annotation. These annotations have retention policy CLASS and only require a compile-time dependency to biz.aQute.bnd:biz.aQute.bnd.annotation.
Nevertheless from my experience projects that are not familiar with OSGi but are asked to add OSGi metadata (e.g. by using the bnd-maven-plugin) are often reluctant to add these, for them, 'random/foreign/unknown' annotations to their code base.

At the same projects that provide services often already manually maintain their service descriptor files.
BND can also generate this file, but at the same time this file provides the most important information about service providers.
Therefore it would be quite convenient if bnd would consider an existing service descriptor file as an (optional alternative) source to gather service providers.
At the moment the necessary requirements and capabilities are maintained explicitly as bnd-instructions as a work-around in such cases.

@pkriens
Copy link
Member

pkriens commented Nov 27, 2023

No problem with this functionality, will you provide a PR?

@pkriens
Copy link
Member

pkriens commented Nov 30, 2023

It might be an idea to bring the ServiceProvider/ServiceConsumer in the realm of OSGi. This tends to ease the anxiety.

@HannesWell
Copy link
Contributor Author

No problem with this functionality, will you provide a PR?

Great. I can give it a try, but I have to admit it is not the No.1 on my priority list.
Nevertheless can you give me some pointers where the start best?

It might be an idea to bring the ServiceProvider/ServiceConsumer in the realm of OSGi. This tends to ease the anxiety.

Yes that will probably already help.

@pkriens
Copy link
Member

pkriens commented Dec 1, 2023

I am taking a look at it, so wait a bit.

pkriens added a commit to pkriens/bnd that referenced this issue Dec 1, 2023
It is possible to add addnotions in the comments of
the  service files of the Service Loader.

Fixes bndtools#5903

---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants