Package org.jboss.byteman.layer
Class LayerModuleFinder
- java.lang.Object
-
- org.jboss.byteman.layer.LayerModuleFinder
-
- All Implemented Interfaces:
java.lang.module.ModuleFinder
public class LayerModuleFinder extends Object implements java.lang.module.ModuleFinder
ModuleFinder implementation used by the module installed by LayerFactory to locate class definitions when an attempt is made to load a class into the module. The finder uses a ModuelReader which passes the request back to the installer of the module, allowing it either to generate or load the class definition as it sees fit.
-
-
Constructor Summary
Constructors Constructor Description LayerModuleFinder(String moduleName, String[] exportsNames, String[] requiresNames, java.util.function.Function<String,byte[]> classMapper)
construct a finder for a single module populated with classes by the supplier classmapper
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<java.lang.module.ModuleReference>
find(String name)
Set<java.lang.module.ModuleReference>
findAll()
-
-
-
Constructor Detail
-
LayerModuleFinder
public LayerModuleFinder(String moduleName, String[] exportsNames, String[] requiresNames, java.util.function.Function<String,byte[]> classMapper)
construct a finder for a single module populated with classes by the supplier classmapper- 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 function 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".
-
-