public class SimpleModuleManager extends java.lang.Object implements LauncherModulesManager
| Modifier and Type | Class and Description |
|---|---|
protected class |
SimpleModuleManager.ModulesVisitor |
| Modifier and Type | Field and Description |
|---|---|
protected pro.gravit.utils.PublicURLClassLoader |
classLoader |
protected SimpleModuleContext |
context |
protected LauncherInitContext |
initContext |
protected java.util.List<java.lang.String> |
moduleNames |
protected java.util.List<LauncherModule> |
modules |
protected ModulesConfigManager |
modulesConfigManager |
protected java.nio.file.Path |
modulesDir |
| Constructor and Description |
|---|
SimpleModuleManager(java.nio.file.Path modulesDir,
java.nio.file.Path configDir) |
| Modifier and Type | Method and Description |
|---|---|
void |
autoload() |
void |
autoload(java.nio.file.Path dir) |
<T extends LauncherModule> |
findModule(java.lang.Class<? extends T> clazz,
java.util.function.Predicate<pro.gravit.utils.Version> versionPredicate) |
ModulesConfigManager |
getConfigManager() |
LauncherModule |
getCoreModule() |
<T extends LauncherModule> |
getModule(java.lang.Class<? extends T> clazz) |
LauncherModule |
getModule(java.lang.String name) |
<T> T |
getModuleByInterface(java.lang.Class<T> clazz) |
java.lang.ClassLoader |
getModuleClassLoader() |
<T> java.util.List<T> |
getModulesByInterface(java.lang.Class<T> clazz) |
void |
initModules(LauncherInitContext initContext) |
<T extends LauncherModule.Event> |
invokeEvent(T event)
Invoke event processing for all modules.
|
LauncherModule |
loadModule(LauncherModule module) |
LauncherModule |
loadModule(java.nio.file.Path file) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsModule, containsModuleprotected final java.util.List<LauncherModule> modules
protected final java.util.List<java.lang.String> moduleNames
protected final SimpleModuleContext context
protected final ModulesConfigManager modulesConfigManager
protected final java.nio.file.Path modulesDir
protected LauncherInitContext initContext
protected pro.gravit.utils.PublicURLClassLoader classLoader
public SimpleModuleManager(java.nio.file.Path modulesDir,
java.nio.file.Path configDir)
public void autoload()
throws java.io.IOException
java.io.IOExceptionpublic void autoload(java.nio.file.Path dir)
throws java.io.IOException
java.io.IOExceptionpublic void initModules(LauncherInitContext initContext)
public LauncherModule loadModule(LauncherModule module)
loadModule in interface LauncherModulesManagerpublic LauncherModule loadModule(java.nio.file.Path file) throws java.io.IOException
loadModule in interface LauncherModulesManagerjava.io.IOExceptionpublic LauncherModule getModule(java.lang.String name)
getModule in interface LauncherModulesManagerpublic LauncherModule getCoreModule()
getCoreModule in interface LauncherModulesManagerpublic java.lang.ClassLoader getModuleClassLoader()
getModuleClassLoader in interface LauncherModulesManagerpublic <T extends LauncherModule> T getModule(java.lang.Class<? extends T> clazz)
getModule in interface LauncherModulesManagerpublic <T> T getModuleByInterface(java.lang.Class<T> clazz)
getModuleByInterface in interface LauncherModulesManagerpublic <T> java.util.List<T> getModulesByInterface(java.lang.Class<T> clazz)
getModulesByInterface in interface LauncherModulesManagerpublic <T extends LauncherModule> T findModule(java.lang.Class<? extends T> clazz, java.util.function.Predicate<pro.gravit.utils.Version> versionPredicate)
findModule in interface LauncherModulesManagerpublic <T extends LauncherModule.Event> void invokeEvent(T event)
LauncherModulesManagerinvokeEvent in interface LauncherModulesManagerT - event typeevent - event handledpublic ModulesConfigManager getConfigManager()
getConfigManager in interface LauncherModulesManager