Hello all,
 
I have a layer with many class loaders (created using public static 
ModuleLayer.Controller defineModulesWithManyLoaders​(Configuration cf,  
List<ModuleLayer> parentLayers, ClassLoader parentLoader)).
 
Let’s suppose we have there three modules (a,b,c). One of the module provides 
FooService. As I understand to find AService in this layer we can use class 
loader of ANY module in this layer (any of a,b,c). For example
 
ServiceLoader.load(FooService.class, 
layer.modules().stream().findAny().get().getClassLoader());
 
Could anyone say if this statement and this code are correct or not?
 
--
Best regards, Alex Orlov

Reply via email to