T - type of module this manager can manage.public interface ModuleManager<T extends RuntimeModule>
RuntimeModules, which takes care of their lifecycle.| Modifier and Type | Method and Description |
|---|---|
void |
checkNotAlreadyRegistered(RuntimeModule module)
Check that the given module isn't already registered with the manager.
|
void |
cleanupMetadata(Set<String> usedModules)
Perform cleanup metadata written by modules that are no longer present.
|
<M extends RuntimeModule> |
getModule(Class<M> clazz)
Get a module registered with the manager.
|
<M extends RuntimeModule> |
getModule(String moduleId,
Class<M> clazz)
Get a module registered with the manager.
|
Set<String> |
loadMetadata()
Load module metadata from wherever they are stored in between database restarts and do whatever is necessary
to do with this metadata before the modules can be used.
|
void |
registerModule(T module)
Register a module with this manager.
|
void |
shutdownModules()
Bring all modules to an orderly shutdown, when the database is stopped.
|
void |
startModules()
Perform work needed to make modules start doing their job.
|
void checkNotAlreadyRegistered(RuntimeModule module)
module - to check.IllegalStateException - in case the module is already registered.void registerModule(T module)
module - to register.IllegalStateException - in case the module is already registered.<M extends RuntimeModule> M getModule(String moduleId, Class<M> clazz)
M - type of the class above.moduleId - module ID.clazz - expected class of the module.null if no such module exists.<M extends RuntimeModule> M getModule(Class<M> clazz)
M - type of the class above.clazz - class of the module.null if no such module exists.IllegalStateException - if more than one module of the same type has been registered.Set<String> loadMetadata()
void cleanupMetadata(Set<String> usedModules)
usedModules - IDs of all modules that are known to be used by the runtime during the current run.void startModules()
void shutdownModules()
Copyright © 2013-2016–2018 Graph Aware Limited. All rights reserved.