Package org.jboss.byteman.jigsaw
Class JigsawAccessEnabler
- java.lang.Object
-
- org.jboss.byteman.jigsaw.JigsawAccessEnabler
-
- All Implemented Interfaces:
AccessEnabler
public class JigsawAccessEnabler extends Object implements AccessEnabler
Implementation of AccessEnabler for use in a Jigsaw enabled JDK runtime n.b. this class is only exemplary and must not be compiled into the Byteman jar. It is supposed to be generated at runtime and installed by the classloader for the org.jboss.byteman.jigsaw module created by the LayerFactory.
-
-
Field Summary
Fields Modifier and Type Field Description booleanDEBUGflag to allow debug trace to be generated
-
Constructor Summary
Constructors Constructor Description JigsawAccessEnabler(Instrumentation inst)create an AccessEnabler that is capable of ensuring access when running inside a Jigsaw enabled JDK.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessibleConstructorInvokercreateConstructorInvoker(Constructor constructor)AccessibleFieldGettercreateFieldGetter(Field field)AccessibleFieldSettercreateFieldSetter(Field field)AccessibleMethodInvokercreateMethodInvoker(Method method)voidensureAccess(AccessibleObject accessible)ensure that accessible can be accessed using reflection or a method handlebooleanrequiresAccess(Class<?> klazz)test whether reference to the class from a classpath class requires the use of reflection or a method handle and possibly also module jiggery-pokery.booleanrequiresAccess(AccessibleObject accessible)test whether access to the accessible from a classpath class requires the use of reflection or a method handle and possibly also module jiggery-pokery.
-
-
-
Constructor Detail
-
JigsawAccessEnabler
public JigsawAccessEnabler(Instrumentation inst)
create an AccessEnabler that is capable of ensuring access when running inside a Jigsaw enabled JDK. This constructor throws an exception if it is not provided with a non-null Instrumentation instance as argument, effectively limiting the use of this class to JVMTI agents.- Parameters:
inst- the instrumentation instance we need to use to enable access
-
-
Method Detail
-
requiresAccess
public boolean requiresAccess(Class<?> klazz)
test whether reference to the class from a classpath class requires the use of reflection or a method handle and possibly also module jiggery-pokery.- Specified by:
requiresAccessin interfaceAccessEnabler- Parameters:
klazz- the class to be checked- Returns:
- true if reference to the class from a classpath class requires the use of reflection or a method handle and possibly module jiggery-pokery otherwise false.
-
requiresAccess
public boolean requiresAccess(AccessibleObject accessible)
Description copied from interface:AccessEnablertest whether access to the accessible from a classpath class requires the use of reflection or a method handle and possibly also module jiggery-pokery.- Specified by:
requiresAccessin interfaceAccessEnabler- Parameters:
accessible- this must be a Member- Returns:
- true if access requires reflection or a method handle and possibly also module jiggery-pokery otherwise false.
-
ensureAccess
public void ensureAccess(AccessibleObject accessible)
ensure that accessible can be accessed using reflection or a method handle- Specified by:
ensureAccessin interfaceAccessEnabler- Parameters:
accessible- this must be a Member
-
createMethodInvoker
public AccessibleMethodInvoker createMethodInvoker(Method method)
- Specified by:
createMethodInvokerin interfaceAccessEnabler
-
createConstructorInvoker
public AccessibleConstructorInvoker createConstructorInvoker(Constructor constructor)
- Specified by:
createConstructorInvokerin interfaceAccessEnabler
-
createFieldGetter
public AccessibleFieldGetter createFieldGetter(Field field)
- Specified by:
createFieldGetterin interfaceAccessEnabler
-
createFieldSetter
public AccessibleFieldSetter createFieldSetter(Field field)
- Specified by:
createFieldSetterin interfaceAccessEnabler
-
-