Package org.jboss.byteman.agent
Class AccessManager
java.lang.Object
org.jboss.byteman.agent.AccessManager
Class used to construct an AccessEnabler appropriate to the
JDK Byteman is running in i.e. whether or not it includes
modules.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AccessEnabler
init
(Instrumentation inst) Create and return an AccessEnabler to manage enabling reflective access.private static AccessEnabler
-
Constructor Details
-
AccessManager
public AccessManager()
-
-
Method Details
-
init
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
-
initDefault
-