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

Tim Diekmann tdiekman at tibco.com
Mon Jun 18 12:06:19 PDT 2012


This kind of problem looks very familiar.

Has anyone taken a look at the OSGi Resolver lately? It has a solution for
the resolution of resources with capabilities and requirements and the
latest OSGi Spec R5 has made that a separate service.

Just a thought, trying to prevent the wheel being re-invented.

  Tim.





On 6/18/12 5:00 AM, "Paul Sandoz" <paul.sandoz at oracle.com> wrote:

>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