Trusted service?
mark.reinhold at oracle.com
mark.reinhold at oracle.com
Wed Aug 13 15:31:19 UTC 2014
2014/8/13 7:20 -0700, alan.bateman at oracle.com:
> The usual thing is to just have a default implementation that is used
> when ServiceLoader doesn't locate a useful provider. You'll find many
> examples of this in the JDK. In those cases then the default is not
> listed in a services configuration file. From what you describe then
> this may be what you want too.
>
> ServiceLoader does not have a way to configure a preferred provider so
> this is one reason why you'll see places where a system property can be
> used to configured the preferred implementation.
Another alternative is to use the ServiceLoader::loadInstalled method,
which will ignore providers on the application class path.
- Mark
More information about the core-libs-dev
mailing list