How to get JPMS layers from external java application using agent?

Alan Bateman alan.bateman at oracle.com
Sun Aug 25 08:39:39 UTC 2024



On 25/08/2024 08:39, PavelTurk wrote:
> :
>
> And a last question. Why there is no API that provides all existing 
> layers. For example ModuleLayer:getLayers() to return all
> layers and what you think about adding this API?

This may be interesting for monitoring/observability purposes but it's 
not really something for a user facing API. Module layers may be 
transient (as you know) and it would add overhead to track. Using the 
snapshot of all loaded classes, which is exposed for observability 
purposes, should just work without needing additional API.

-Alan


More information about the jigsaw-dev mailing list