uses is useless ?
David M. Lloyd
david.lloyd at redhat.com
Wed Nov 16 14:36:53 UTC 2016
On 11/16/2016 08:06 AM, Alan Bateman wrote:
> On 16/11/2016 14:00, David M. Lloyd wrote:
>
>>
>> That's really a usability regression though, isn't it? In the past, I
>> could always use ServiceLoader with a ClassLoader argument to specify
>> on whose behalf I'm loading. In fact we do this quite a lot today.
>>
> No change to existing code on the class path, the question only comes up
> when migrating to an explicit module (meaning you are writing a module
> declaration). It's a reasonable question to ask of course.
Of course, but assuming one ports existing code to be modular and expect
to live in a modular environment, it's still perfectly reasonable to
want to load services on behalf of another module. I disagree with
using Lookup for this purpose, but a simple method (even on Module
itself) to create a service loader from that module's perspective would
be very useful for this. In fact we do this in JBoss Modules.
--
- DML
More information about the jigsaw-dev
mailing list