@Singleton public class ModuleRegistryImpl extends Object implements ModuleRegistry
ModuleRegistry.Factory
Constructor and Description |
---|
ModuleRegistryImpl() |
Modifier and Type | Method and Description |
---|---|
ModuleDefinition |
getDefinition(String name) |
List<ModuleDefinition> |
getModuleDefinitions()
Returns the list of known ModuleDefinitions, as ordered by the loading mechanism (typically in dependency order).
|
<T> T |
getModuleInstance(Class<T> moduleClass)
Returns the module's instance.
|
Object |
getModuleInstance(String name)
Returns the module's instance.
|
Set<String> |
getModuleNames()
Returns the names of configured modules.
|
ModuleVersionHandler |
getVersionHandler(String name) |
boolean |
isModuleRegistered(String name) |
void |
registerModuleDefinition(String name,
ModuleDefinition moduleDefinition) |
void |
registerModuleInstance(String name,
Object moduleInstance) |
void |
registerModuleVersionHandler(String name,
ModuleVersionHandler moduleVersionHandler) |
public void registerModuleDefinition(String name, ModuleDefinition moduleDefinition)
registerModuleDefinition
in interface ModuleRegistry
public void registerModuleInstance(String name, Object moduleInstance)
registerModuleInstance
in interface ModuleRegistry
public void registerModuleVersionHandler(String name, ModuleVersionHandler moduleVersionHandler)
registerModuleVersionHandler
in interface ModuleRegistry
public boolean isModuleRegistered(String name)
isModuleRegistered
in interface ModuleRegistry
public ModuleDefinition getDefinition(String name)
getDefinition
in interface ModuleRegistry
public Object getModuleInstance(String name)
ModuleRegistry
getModuleInstance
in interface ModuleRegistry
for a type-safer method to get module instances
public <T> T getModuleInstance(Class<T> moduleClass)
ModuleRegistry
getModuleInstance
in interface ModuleRegistry
public ModuleVersionHandler getVersionHandler(String name)
getVersionHandler
in interface ModuleRegistry
public Set<String> getModuleNames()
ModuleRegistry
getModuleNames
in interface ModuleRegistry
public List<ModuleDefinition> getModuleDefinitions()
ModuleRegistry
getModuleDefinitions
in interface ModuleRegistry
Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.