[External] : Re: How to open a package from a module in the boot layer to a module in another layer?

Code Ranger coderanger2025 at outlook.com
Tue Jan 14 14:13:36 UTC 2025



On 1/14/25 15:42, Ron Pressler wrote:
> What I’m saying is that since you agree that granting some component the power to decide, at runtime, that strings are not immutable and that the number 5 may sometimes have the value of 6 (as that’s what opening java.base means) will still require some static configuration, then globally changing the semantics of Java code at runtime is already possible in this way via agents (https://docs.oracle.com/en/java/javase/23/docs/api/java.instrument/java/lang/instrument/Instrumentation.html#redefineModule(java.lang.Module,java.util.Set,java.util.Map,java.util.Map,java.util.Set,java.util.Map)). The JDK already supports this and so there’s no need for yet another mechanism.
>
> — Ron

Ron, thank you for your suggestion. I didn't know about it. I have no experience working with agents, so I just read about them. Based on what I’ve read, I’ve formed the impression that agents are not the most suitable solution in terms of performance and flexibility when interacting with the main application.

It seems to me that using agents is the wrong direction. Providing access to the boot layer controller appears to be a simpler and more straightforward solution.

Best regards, CR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jigsaw-dev/attachments/20250114/82975f7a/attachment.htm>


More information about the jigsaw-dev mailing list