JCE providers as services

Alan Bateman Alan.Bateman at oracle.com
Tue Jun 19 11:33:34 PDT 2012


On 19/06/2012 18:48, Sean Mullan wrote:
> I'm working on trying to convert the JCE providers to modular services.
>
> In the JDK, more than one module will need to export/provide the same 
> JCE service interface. Is this a problem?
>
> For example:
>
> 1. jdk.crypto at 8-ea
>    ...
>      provides service java.security.Provider
>        with com.sun.crypto.provider.SunJCE
>
> 2. jdk.xmldsig at 8-ea
>    ...
>      provides service java.security.Provider
>        with org.jcp.xmldsig.internal.dom.XMLDSigRI
>
> Will a service consumer be able to discover all of the installed JCE 
> services just by adding a "requires service java.security.Provider"? 
> In other words, I'm assuming it doesn't need to also add the modules 
> exporting that service as a dependency.
That's right, and you use java.util.ServiceLoader to iterate over the 
service providers at runtime.

-Alan.



More information about the jigsaw-dev mailing list