> On 14 Jan 2025, at 17:12, Code Ranger <coderanger2...@outlook.com> wrote:
> 
> 
> Regarding the agent — who is ready to add such an agent to their application 
> to manage module directives and present it to the community?

I would think that certainly anyone who’s writing a project that lets any code, 
including code loaded dynamically at runtime, redefine the semantics of Java 
globally for the application would have no problem at all using an agent. An 
agent *is* how Java programs change, at runtime, various things that are 
otherwise static, and that is exactly what you’re asking to do. There are many 
big and important Java programs running in production with agents, and most of 
them are programs that don’t even go as far as you aim to in terms of liberties 
granted to dynamically loaded code.

> 
> I have nothing else to add. Really, nothing. The ball is in your court. 
> Either reopen the issue, or Java developers, to the delight of developers in 
> C#, Python, JS, etc., will have to write such instructions for their plugins:
> 
> 1. Install the plugin.
> 2. Stop the application.
> 3. Add --add-exports ..., --add-opens ....
> 4. Restart the application.

These things are not required.

You can do what you want without any restarts or reconfiguration with just 
plain Java code *except* when dynamically loaded plugins want to manipulate the 
inner workings of the JDK itself, something that you’d really want to raise a 
red flag over. And if you’re fine with letting plugin code manipulate the 
runtime, you can simply add a single flag specifying an agent, which is not 
only how Java has always supported things of this sort but also requires the 
same configuration effort as in your suggestion — a single flag.

It’s not a matter of not recognising that what you want may sometimes be 
pragmatically needed. It’s just that everything you’re asking for is already 
delivered and you’re requesting a feature that already exists.

— Ron


Reply via email to