Hello,
I have the following requirement to implement:

Reading and testing JBoss Modules it seems to me the solution to my issue.

I configured a set of modules and succeeded starting my Server with a module.

Now I am trying to create dynamically the new classloaders which are composed of :

So my idea was to do the following:

So code would look something like:

        ModuleIdentifier identifier = ModuleIdentifier.fromString("my new class loader");
        Builder builder = ModuleSpec.build(identifier);
        DependencySpec dependencySpec =
                DependencySpec.createModuleDependencySpec(
                        ModuleIdentifier.create("com.ubikingenierie.myserver"));
        builder.addDependency(dependencySpec);

builder.addResourceRoot(ResourceLoaderSpec.createResourceLoaderSpec(ResourceLoaders.createJarResourceLoader(
                  "name-of-jar1", new JarFile(new File("path to jar1")))));
builder.addResourceRoot(ResourceLoaderSpec.createResourceLoaderSpec(ResourceLoaders.createJarResourceLoader(
                  "name-of-jar2", new JarFile(new File("path to jar2")))));


        ModuleSpec moduleSpec = builder.create();
...> > What's next ??????


I am stuck here because I don't understand how from this to create the ClassLoader as I need a Module Loader to build the Module then access ClassLoader

And the issue is which one ? cause to get access to "com.ubikingenierie.myserver" I need the root one which I could access like this:

But I don't see how to make it load my module , cause If I call loadModule it won't find ""my new class loader" as it's not in it.


And If I create a new subclass of ModuleLoader I don't see how to make it use LocalModuleLoader for existing modules.

I looked at ClassifyingModuleLoader which seemed to be a solution but I don't understand how to use it (no doc , no test case ...)


Anyone can help ?

Thanks

Regards

--
Cordialement.
Philippe M.