Class loader layer registration (8346946)

Alex Buckley alex.buckley at oracle.com
Thu Jan 9 18:04:44 UTC 2025


On 1/9/2025 6:29 AM, David Lloyd wrote:
> Sometimes it is desirable to load a plugin (for example) where the 
> module(s) in the plugin provide services but the plugin should be loaded 
> into a layer that is isolated from (i.e. a sibling to) the service- 
> consuming layer, which is generally a private implementation layer or a 
> peer plugin. 

We do not intend to provide isolation with the module system. We intend 
to provide strong encapsulation: If the plugin module does not export 
its provider code, then the JVM prevents access to that code by the 
service-consuming code (even if it's in the same layer and class loader 
as the provider code). We expect the framework which loads the plugin to 
arrange the exports of the plugin module as necessary to achieve this.

I am not clear why the framework which loads the plugin is unable to use 
the JVM-backed access control mechanism to prevent consumers from 
accessing provider code directly.

Alex


More information about the jigsaw-dev mailing list