Re: Adding modules from a child layer

2025-03-16 Thread Alan Bateman
On 14/03/2025 12:10, Simone Bordet wrote: : With some archeology, I found: https://urldefense.com/v3/__https://bugs.eclipse.org/bugs/show_bug.cgi?id=347110__;!!ACWV5N9M2RV99hQ!IW-lZcO8m0GajZDPc4BK-QlJTTyR0a8NZNZT4IFVuTZWTd4j0sJZ0MThsyXFb3W1ez6iScbbkrxHxFmx3lbHGnyQ$ :) TLDR: Spring had (has?

Re: Adding modules from a child layer

2025-03-15 Thread Simone Bordet
Hi Alan, On Fri, Mar 14, 2025 at 12:23 PM Alan Bateman wrote: > In this case, the initial module is a named module that doesn't transitively > require java.instrument so that module is not in the boot layer. If they > server was started with -javaagent then the java.instrument would be in the

Re: Adding modules from a child layer

2025-03-14 Thread Alex Buckley
On 3/14/2025 3:54 AM, Simone Bordet wrote: As a side question, I was wondering what is the benefit of using ModuleLayers versus just using ClassLoaders. As Alan mentioned, layers are how you get strong encapsulation, where the accessibility of classes in modules is enforced by the VM. This is

Re: Adding modules from a child layer

2025-03-14 Thread Alan Bateman
On 14/03/2025 10:54, Simone Bordet wrote: : The question is whether there is a way for a child ModuleLayer to perform the equivalent of "--add-modules", but programmatically at runtime, that would add the module to the graph? Module layers are immutable so you can't modify the boot layer at

Re: Adding modules from a child layer

2025-03-14 Thread Code Ranger
There is a  framework for working with layers, see https://github.com/techsenger/alpha It has several demos and every demo shows how to work with Jetty 12 and Web application when they are in different layers. Maybe it can be interesting for you. On 3/14/25 12:54, Simone Bordet wrote: Hi, I'm