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

Support ServiceLoader #944

Open
SchulteMarkus opened this issue Apr 11, 2019 · 1 comment
Open

Support ServiceLoader #944

SchulteMarkus opened this issue Apr 11, 2019 · 1 comment
Labels
proposal Proposed Specification or API change waiting for votes Enhancements or changes proposed that need more support before consideration

Comments

@SchulteMarkus
Copy link

SchulteMarkus commented Apr 11, 2019

Java has a class java.util.ServiceLoader (in this package available from JDK6 onwards).

A facility to load implementations of a service.
A service is a well-known interface or class for which zero, one, or many service providers exist. A service provider (or just provider) is a class that implements or subclasses the well-known interface or class. A ServiceLoader is an object that locates and loads service providers deployed in the run time environment at a time of an application's choosing. Application code refers only to the service, not to service providers, and is assumed to be capable of choosing between multiple service providers (based on the functionality they expose through the service), and handling the possibility that no service providers are located.

Feature request: Please support ServiceLoader by placing the required files in META-INF/services.

Background

You may already have heard of SubstrateVM (part of GraalVM)

Substrate VM is a framework that allows ahead-of-time (AOT) compilation of Java applications under closed-world assumption into executable images or shared objects (ELF-64 or 64-bit Mach-O).

SubstrateVM supports META-INF/services as part of the compilation process (done in oracle/graal#563, released https://www.graalvm.org/docs/release-notes/#10-rc8).

So, if you support ServiceLoader, you add (part of) support for SubstrateVM, too.

Example

Micronaut can be compiled using SubstrateVM. One example for META-INF/services can be found at https://github.com/micronaut-projects/micronaut-core/tree/master/inject/src/main/resources/META-INF/services

@kdavisk6 kdavisk6 added enhancement For recommending new capabilities waiting for votes Enhancements or changes proposed that need more support before consideration proposal Proposed Specification or API change and removed enhancement For recommending new capabilities waiting for votes Enhancements or changes proposed that need more support before consideration labels Apr 11, 2019
@velo
Copy link
Member

velo commented Apr 22, 2019

@SchulteMarkus do you think a generated implementation would solve the graalVM problem?

https://github.com/velo/feign/pull/3/files

Could you test and help me automate tests with graal VM so I can continue developing this feature?

@kdavisk6 kdavisk6 added the waiting for votes Enhancements or changes proposed that need more support before consideration label May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposed Specification or API change waiting for votes Enhancements or changes proposed that need more support before consideration
Projects
None yet
Development

No branches or pull requests

3 participants