Class PluginModuleManager
java.lang.Object
com.thewinterframework.plugin.module.PluginModuleManager
- All Implemented Interfaces:
Iterable<Class<? extends PluginModule>>
This class is responsible for scanning, registering, loading, enabling, and disabling plugin modules.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet<com.google.inject.Module> Gets the registered modules.booleanDisables the modules.booleanEnables the modules.<T extends PluginModule>
TGets the module of the given class.booleanInjects the modules.booleanisRegistered(Class<? extends PluginModule> clazz) Checks if the given module is registered.@NotNull Iterator<Class<? extends PluginModule>> iterator()booleanLoads the registered modules.booleanregisterModule(Class<? extends PluginModule> module) Registers the given module.booleanScans the modules for the plugin.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PluginModuleManager
-
-
Method Details
-
scanModules
public boolean scanModules()Scans the modules for the plugin.- Returns:
trueif the modules were scanned successfully,falseotherwise.
-
registerModule
Registers the given module.- Parameters:
module- the module to register.- Returns:
trueif the module was registered successfully,falseotherwise.
-
loadModules
public boolean loadModules()Loads the registered modules.- Returns:
trueif the modules were loaded successfully,falseotherwise.
-
injectModules
public boolean injectModules()Injects the modules.- Returns:
trueif the modules were injected successfully,falseotherwise.
-
enableModules
public boolean enableModules()Enables the modules.- Returns:
trueif the modules were enabled successfully,falseotherwise.
-
disableModules
public boolean disableModules()Disables the modules.- Returns:
trueif the modules were disabled successfully,falseotherwise.
-
isRegistered
Checks if the given module is registered.- Parameters:
clazz- the module class to check.- Returns:
trueif the module is registered,falseotherwise.
-
getModule
Gets the module of the given class.- Type Parameters:
T- the type of the module.- Parameters:
clazz- the module class to get.- Returns:
- the module of the given class, or
nullif the module is not registered.
-
asGuiceModules
Gets the registered modules.- Returns:
- the registered modules.
-
iterator
- Specified by:
iteratorin interfaceIterable<Class<? extends PluginModule>>
-