Service Providersand versioning
Alan Bateman
Alan.Bateman at oracle.com
Wed Apr 18 10:13:17 PDT 2012
On 18/04/2012 16:50, Sean Mullan wrote:
>
> But a Provider is not a Service. It is more equivalent to a
> ServiceLoader.
Okay but I'm just observing that the security providers are listed today
in java.security, and if converted to services, then you could iterate
over them with ServiceLoader.load(java.security.Provider.class).
>
> I would have expected something more like:
>
> module sun.ec @ 8-ea {
> provides service java.security.Signature
> with sun.security.ec.ECDSASignature;
> }
>
> So basically, the Provider API doesn't come into play at all in
> finding JCE services.
That should work fine and you will iterate over the Signature
implementations with ServiceLoader.load(Signature.class).
As Jesse pointed out, there isn't anything in Jigsaw to aid with the
selection when there are several service providers installed, ie: there
isn't anything to match on capabilities or attributes.
-Alan.
More information about the jigsaw-dev
mailing list