<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<br>
<div class="moz-cite-prefix">On 1/15/25 11:22, Andrew Dinn wrote:<br>
</div>
<blockquote type="cite" cite="mid:9cb2b530-39d2-4f29-81b1-5ab923597195@redhat.com">On
14/01/2025 17:12, Code Ranger wrote:
<br>
<blockquote type="cite">Regarding the agent — who is ready to add
such an agent to their application to manage module directives
and present it to the community?
<br>
</blockquote>
<br>
Well, there is already one example of an agent that manages access
to module private code which is widely in use by the community. On
JDK9+ Byteman allows injected code to access methods that are not
exported by modules, using the module open APIs provided to class
Instrumentation. It does so using its own module layer and
associated controller. It is also implemented to behave compatibly
on JDK8 where it achieves the same outcome using reflection. Most
notably, on JDK9+ Byteman avoids exposing those unexported methods
to anything other than the injected code.
<br>
<br>
</blockquote>
<br>
Andrew, thank you for you this example. From
<a class="moz-txt-link-freetext" href="https://github.com/bytemanproject/byteman">https://github.com/bytemanproject/byteman</a> (if this is the project
you are talking about):<br>
<br>
Byteman supports injection of side effects into Java programs for
the purpose of <b>tracing </b>and <b>testing</b> application
behaviour.<br>
<br>
No, I am sure, using agents to add open/export to a module from the
boot layer can hardly be called an optimal and elegant solution. <br>
<br>
Therefore, I decided to abandon their use. The topic is closed.
--add-* forever.
</body>
</html>