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

Alan Bateman Alan.Bateman at oracle.com
Mon Jun 18 03:01:42 PDT 2012


On 18/06/2012 10:00, Paul Sandoz wrote:
> :
> 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.
I think this comes down as to whether a service provider module's 
dependencies (and transitive dependencies) are allowed to change the 
solution that would otherwise be arrived at if the service provider 
module were not present. At the moment it can change the solution, 
meaning that the dependencies are treated equally as it tries to find a 
solution.

Assuming they are to be treated equally then, and with permits out of 
the equation for service modules, then a possible route is to change the 
Choice stack so that it is requesting module -> Dependence rather than a 
ViewDependence. That way it knows whether to check permits or not. The 
result should be the same as today, assuming that service modules don't 
have a permits clause.

-Alan.



More information about the jigsaw-dev mailing list