Dump services webrev
Alan Bateman
Alan.Bateman at oracle.com
Tue May 29 08:04:48 PDT 2012
On 25/05/2012 22:38, Paul Sandoz wrote:
> :
> There is a distinction between a service *factory* and a set of services all of which are relevant [*]. For the latter case a rogue service can mess up access to the subset of those that come after it (and that subset is arbitrary and could change for each execution of the VM).
>
> I think we need some ability for the developer to control what should be done under such circumstances (e.g. some callback that decides to continue or re-throw). This is a good use-case for ModuleServiceProvider.
>
I agree that provider interfaces that are themselves factories are less
likely to fail at instantiation time. I also agree there will be cases
where you want to take some action, log or emit an warning for example,
and attempt to continue. However I'm not convinced that it will be can
be reliable in the face of a rogue service though, especially if it goes
into a loop or hits a resource error. As it stands we have the SCE and
while not pretty, it at least gives the caller some control. It's
probably not worth adding policy support to ServiceLoader but may be
something for a replacement in the future if we decide to go in that
direction.
-Alan.
More information about the jigsaw-dev
mailing list