Package org.jboss.byteman.agent
Class AccessManager
- java.lang.Object
-
- org.jboss.byteman.agent.AccessManager
-
public class AccessManager extends java.lang.Object
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 Constructor Description AccessManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AccessEnabler
init(java.lang.instrument.Instrumentation inst)
Create and return an AccessEnabler to manage enabling reflective access.private static AccessEnabler
initDefault()
-
-
-
Method Detail
-
init
public static AccessEnabler init(java.lang.instrument.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
-
initDefault
private static AccessEnabler initDefault()
-
-