public final class ModuleLoader extends Destroyable
| Modifier and Type | Class and Description |
|---|---|
static class |
ModuleLoader.ClassEntry
Represents a class entry (DTO).
|
| Constructor and Description |
|---|
ModuleLoader(org.codehaus.plexus.classworlds.realm.ClassRealm realm,
ModuleRegistry registry,
Injector injector)
Creates a new module loader.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
destroy()
Attempts to "destroy" the object by clearing memory (e.g.
|
ModuleLoader.ClassEntry |
getClassEntry(Class<? extends Module> implClass)
Fetches the class entry for the given module implementation class.
|
org.codehaus.plexus.classworlds.realm.ClassRealm |
getRealm()
Returns the underlying class realm that gets used when loading classes.
|
boolean |
ignoreModuleClass(Class<? extends Module> ignore)
Adds the given class to the list of ignored module superclasses / -interfaces.
|
void |
injectAndInitialize(ModuleManager manager,
Module module,
net.mountainblade.modular.impl.ModuleInformationImpl information)
Injects and initializes the given module.
|
Module |
loadModule(ModuleManager moduleManager,
ModuleLoader.ClassEntry classEntry)
Loads a module using its pre-compiled class entry.
|
void |
registerEntry(ModuleLoader.ClassEntry classEntry,
Module module,
net.mountainblade.modular.impl.ModuleInformationImpl information,
ModuleRegistry.Entry moduleEntry)
Registers a new class entry in the system.
|
void |
setLoadingStrategy(Class<? extends org.codehaus.plexus.classworlds.strategy.Strategy> strategyClass)
Sets the loading strategy on the class realm.
|
void |
setLoadingStrategy(org.codehaus.plexus.classworlds.strategy.Strategy strategy)
Sets the loading strategy on the class realm.
|
public ModuleLoader(org.codehaus.plexus.classworlds.realm.ClassRealm realm,
ModuleRegistry registry,
Injector injector)
realm - The realm we load the modules in, this requires their URLs to be added beforehandregistry - The module registry to register the modules withinjector - The injector to inject their fields withpublic org.codehaus.plexus.classworlds.realm.ClassRealm getRealm()
public void setLoadingStrategy(Class<? extends org.codehaus.plexus.classworlds.strategy.Strategy> strategyClass)
strategyClass - The class of the loading strategy to usepublic void setLoadingStrategy(org.codehaus.plexus.classworlds.strategy.Strategy strategy)
strategy - The loading strategy to usepublic boolean ignoreModuleClass(Class<? extends Module> ignore)
ignore - The module super-class to ignore during the loading processpublic Module loadModule(ModuleManager moduleManager, ModuleLoader.ClassEntry classEntry)
moduleManager - The module manager to useclassEntry - The class entry to create the module out ofpublic void injectAndInitialize(ModuleManager manager, Module module, net.mountainblade.modular.impl.ModuleInformationImpl information)
manager - The module manager to usemodule - The module in contextinformation - The module's information instancepublic void registerEntry(ModuleLoader.ClassEntry classEntry, Module module, net.mountainblade.modular.impl.ModuleInformationImpl information, ModuleRegistry.Entry moduleEntry)
classEntry - The class entry to registermodule - The module in contextinformation - The module's information instancemoduleEntry - The registry entrypublic ModuleLoader.ClassEntry getClassEntry(Class<? extends Module> implClass)
implClass - The class of the moduleprotected void destroy()
Destroyabledestroy in class DestroyableCopyright © 2014–2015 MountainBlade. All rights reserved.