Review Request: loading JCE providers using ServiceLoader

Sean Mullan sean.mullan at oracle.com
Thu Aug 9 08:14:02 PDT 2012


Please review the 2nd webrev for my code changes to enable JCE providers to be
registered and loaded as services using the ServiceLoader API:

http://cr.openjdk.java.net/~mullan/jigsaw/webrevs/jce-service/webrev.01/

See [1] for previous discussion.

The main change is that in module-mode all available Providers are now
agressively loaded and cached. The code for loading providers has also been
restructured. There is a new Providers.ProviderLoader interface and subclass
implementations for module and classpath mode.

There are a few outstanding issues that should be looked at later. I will create
a new bug so that we don't lose track of them, but briefly:

1. ServiceLoaders don't support a configured preference order for providers
2. Cannot pass an optional argument (ex: a config file) to a provider via
ServiceLoader
3. Cannot have more than one instance of a provider (ex: the SunPKCS11 Provider
allows multiple instances with different config files)
4. ServiceLoaderConfigurationError does not retain which provider generated the
error

I've worked around some of these in the code, but none is a perfect solution.
However, in the interests of moving forward, I would like to leave these as open
issues for now.

Thanks,
Sean

[1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2012-July/003053.html



More information about the jigsaw-dev mailing list