Class AccessManager


  • public class AccessManager
    extends Object
    Class used to construct an AccessEnabler appropriate to the JDK Byteman is running in i.e. whether or not it includes modules.
    • Constructor Detail

      • AccessManager

        public AccessManager()
    • Method Detail

      • init

        public static AccessEnabler init​(Instrumentation inst)
        Create and return an AccessEnabler to manage enabling reflective access. For JDK8 and lower releases return a DefaultAccessEnabler which does not now about module encapsulation. For JDK9 and higher releases return a JigsawAccessEnabler which is capable of enabling access to members of classes which are normally inaccessible because of module restrictions. caveat: during testing class JigsawAccessEnabler may fail to load even thought the JDK is modular. That happens when testing that the JDK8- core classes work without the JDK9 code present. In this specific situation a DefaultAccessEnabler is returned. A helper trace message is logged just in case.
        Parameters:
        inst - an Instrumentation instance which may be needed enable access to members of unexported module classes
        Returns:
        an AccessEnabler to manage enabling reflective access