Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy creation improvements for JPMS, remove the need for --add-opens in some cases #25132

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Aug 28, 2024

  1. JPMS improvements: use JPMS Lookup class where applicable

    The best way to define a class is to define using an anchor class, which defines its classloader and security policies, and is the only way to define a class in Java 9+ without --add-opens on the command line. The package name of the anchor class must be the same as the new class.
    
    If the conditions are not met, we fall back to calling private methods on the ClassLoader to define classes. This needs --add-opens, otherwise a exception is raised.
    
    Moved global references to the private ClassLoader methods to a separate ClassLoaderMethods class. This means that the global references will be initialized lazily only when needed, to avoid getting an exception on accessing the private methods (if not --add-opens, e.g. in GF Embedded) if they are not needed.
    OndroMih committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    c60947a View commit details
    Browse the repository at this point in the history
  2. JPMS improvements: use JPMS Lookup class for Weld proxies

    Weld specifies a different package name for proxies than for the original class. 
    We change the name of the proxy class using Javassist to keep the original package name so that we can use the Lookup method.
    We keep separate Javassist class pools for separate application classloaders, so that applications don't share them.
    OndroMih committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    daf8de2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7cd0dc3 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2024

  1. JPMS improvements: Experiments with GF Embedded

    Discovered a flaw in the solution for ProxyServiceImpl
    OndroMih committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    3e85563 View commit details
    Browse the repository at this point in the history