Review Request: loading JCE providers using ServiceLoader
Sean Mullan
sean.mullan at oracle.com
Wed Aug 1 13:12:33 PDT 2012
I discovered another issue with respect to using a ServiceLoader to load
JCE providers. In our current JDK implementation, if you try to load a
Provider using Security.getProvider(String) and the Provider's ctor
throws a ProviderException, this gets passed through to the caller.
This type of behavior is difficult to preserve when using a
ServiceLoader. I can catch a ServiceConfigurationError and check the
cause to see if is an instanceof ProviderException, but I don't
necessarily know what Provider threw the exception. Do you see the
problem? If the ServiceConfigurationError also captured the name of the
class, then I could figure out which Provider was throwing the exception
and pass it back through.
Thanks,
Sean
More information about the jigsaw-dev
mailing list