Extending java.base module

Volker Simonis volker.simonis at gmail.com
Wed Feb 15 15:52:28 UTC 2017


Hi Max,

I'm not an jigsaw either, but wouldn't your solution break a tool like jlink?

In other words, if an application uses your code and the developer
uses jlink to create a run-time image, wouldn't that image fail to
execute his application because jlink fails to see that java.base
depends on java.security.jgss in that special case?

Thanks,
Volker


On Wed, Feb 15, 2017 at 9:51 AM, Weijun Wang <weijun.wang at oracle.com> wrote:
> Disclaimer: I am not a jigsaw expert.
>
> The provides/uses mechanism is certainly more formal, but you can also do
> http://hg.openjdk.java.net/jdk9/dev/jdk/rev/d282c1a8d20b.
>
> --Max
>
>
> On 02/15/2017 04:36 PM, Langer, Christoph wrote:
>>
>> Hi Jigsaw experts,
>>
>> as you might or might not know, we have an own JDK implementation with
>> some extension code that is quite interwoven with the jdk.
>>
>> Now I'm looking into how this coding can be spread into a good module
>> structure for jdk9. And I'm not a crack yet on using the module system
>> though I've read quite a bit into the spec documentation available so far;-)
>>
>> The first point for me is that we have to place some of our coding in the
>> java.base module as we used to add private fields and methods to basic
>> classes such as java.lang.Thread or java.lang.Exception. However, I don't
>> want to have so much of our stuff in java.base and rather think that it
>> should live in its own module. So the question here is if it is possible to
>> call code of other modules from java.base, e.g. via the Service Provider
>> interface? I see that I can define a service in java.base and specify some
>> "uses" statement in module-info. But will my implementation of such a
>> service from other modules be available to java.base?
>>
>> Also I'm contemplating about this requirement: I have a class which I
>> would need somewhere in java.base but I'd also like to export it in the
>> public API of my own extension module. So, if I create the class in
>> java.base, I'm not allowed to export this class publicly, unqualified,
>> right? But when I have it living in my extension module, then java.base
>> would not see it. What can I do? Probably create some inherited class in my
>> extension module that extends from the java.base impl and export this??
>>
>> I'm hoping that those are easy questions for you and you can give me some
>> helpful answers.
>>
>> Thanks a lot in advance!!
>>
>> Best regards
>> Christoph
>>
>


More information about the jigsaw-dev mailing list