public abstract class LauncherModule
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LauncherModule.Event |
static interface |
LauncherModule.EventHandler<T extends LauncherModule.Event> |
static class |
LauncherModule.InitStatus
Module initialization status at the current time
|
| Modifier and Type | Field and Description |
|---|---|
protected LauncherModule.InitStatus |
initStatus |
protected LauncherModuleInfo |
moduleInfo |
protected ModulesConfigManager |
modulesConfigManager |
protected LauncherModulesManager |
modulesManager |
| Modifier | Constructor and Description |
|---|---|
protected |
LauncherModule() |
protected |
LauncherModule(LauncherModuleInfo info) |
| Modifier and Type | Method and Description |
|---|---|
<T extends LauncherModule.Event> |
callEvent(T event)
Call the handler of the current module
|
LauncherModule.InitStatus |
getInitStatus() |
LauncherModuleInfo |
getModuleInfo() |
abstract void |
init(LauncherInitContext initContext)
Basic module initialization method
You can:
- Subscribe to events
- Use your dependencies
- Use provided initContext
- Receive modules and access the module’s internal methods
You can not:
- Modify module description, dependencies
- Add modules
- Read configuration
|
LauncherModule |
preInit() |
void |
preInitAction()
This method is called before initializing all modules and resolving dependencies.
|
protected <T extends LauncherModule.Event> |
registerEvent(LauncherModule.EventHandler<T> handle,
java.lang.Class<T> tClass)
Registers an event handler for the current module
|
void |
setContext(LauncherModulesContext context)
The internal method used by the ModuleManager
DO NOT TOUCH
|
LauncherModule |
setInitStatus(LauncherModule.InitStatus initStatus) |
protected LauncherModulesManager modulesManager
protected final LauncherModuleInfo moduleInfo
protected ModulesConfigManager modulesConfigManager
protected LauncherModule.InitStatus initStatus
protected LauncherModule()
protected LauncherModule(LauncherModuleInfo info)
public LauncherModuleInfo getModuleInfo()
public LauncherModule.InitStatus getInitStatus()
public LauncherModule setInitStatus(LauncherModule.InitStatus initStatus)
public void setContext(LauncherModulesContext context)
context - Private contextpublic void preInitAction()
public LauncherModule preInit()
public abstract void init(LauncherInitContext initContext)
initContext - null on module initialization during boot or startup
Not null during module initialization while runningprotected <T extends LauncherModule.Event> boolean registerEvent(LauncherModule.EventHandler<T> handle, java.lang.Class<T> tClass)
T - event typehandle - your event handlertClass - event classpublic final <T extends LauncherModule.Event> void callEvent(T event)
T - event typeevent - event handled