Package org.jboss.byteman.layer
Class LayerFactory
- java.lang.Object
-
- org.jboss.byteman.layer.LayerFactory
-
public class LayerFactory extends java.lang.Object
Factory class allowing a JVMTI Java agent to define a Jigsaw Module Layer containing a Jigsaw module for the agent to populate with classes provided as byte arrays in class file format
-
-
Constructor Summary
Constructors Constructor Description LayerFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Module
installModule(java.lang.String moduleName, java.lang.String[] exportsNames, java.lang.String[] requiresNames, java.util.function.Function<java.lang.String,byte[]> classMapper)
Create a module Layer above the boot Layer and install a module into it returning a classloader which can be used to drive installation of classes into the module.
-
-
-
Method Detail
-
installModule
public static java.lang.Module installModule(java.lang.String moduleName, java.lang.String[] exportsNames, java.lang.String[] requiresNames, java.util.function.Function<java.lang.String,byte[]> classMapper)
Create a module Layer above the boot Layer and install a module into it returning a classloader which can be used to drive installation of classes into the module. The class laoder does not install classes from a jar file located on disk. Instead the caller supplies a class mapper which is used to map class names which appear as Strings in the format "x/y/z/MyClass.class" to a corresponding class file format byte array.- Parameters:
moduleName
- the name of the one module to be installed in the layerexportsNames
- an array of names of packages to be exported by the modulerequiresNames
- an array of names of modules to be imported by the moduleclassMapper
- a mapper provided by the caller to populate the module with classes which accepts a class name and returns the corresponding class file format byte array. The name will be presented in the format "x/y/z/MyClass.class".- Returns:
- the module classloader.
-
-