Resolving and services <was> Re: ServiceLoader.load* take 2

Paul Sandoz paul.sandoz at oracle.com
Mon Jun 18 02:00:14 PDT 2012


On Jun 12, 2012, at 5:03 PM, Paul Sandoz wrote:
> - Modify the resolver so that the permits clause does not affect resolution of a service provider module (and it's dependencies). This area is tricky. Rather than choices of service provider module optional dependencies being pushed on to the choice stack of each service consumer module this potentially could be done once per service interface (although will likely change what solutions are produced), but might be very tricky to implement given that service provider modules may also be service consumer modules. Good diagnostics are required to help track down why a service provider module is not being resolved.

Here is my latest thoughts on this:

1) maintain a separate stack of Choice for service provider modules. When the resolver comes across a service consume module add Choice instances to that stack for all known corresponding service provider modules.

2) when the main choice stack is null and is about to return true move all the choices on the service stack to the current stack and keep on processing.

To be experimented with soon...

Paul.


More information about the jigsaw-dev mailing list