info.magnolia.module
Interface ModuleRegistry

All Known Implementing Classes:
ModuleRegistryImpl

public interface ModuleRegistry

Holds instances and definitions of modules.


Nested Class Summary
static class ModuleRegistry.Factory
          Deprecated. since 4.5, use IoC !
 
Method Summary
 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)
           
 

Method Detail

registerModuleDefinition

void registerModuleDefinition(String name,
                              ModuleDefinition moduleDefinition)

registerModuleInstance

void registerModuleInstance(String name,
                            Object moduleInstance)

registerModuleVersionHandler

void registerModuleVersionHandler(String name,
                                  ModuleVersionHandler moduleVersionHandler)

isModuleRegistered

boolean isModuleRegistered(String name)

getModuleInstance

Object getModuleInstance(String name)
Returns the module's instance. This is useful for modules which use a common class (i.e content or theme modules, which can typically co-exist in a system and have the same module class).

Throws:
IllegalArgumentException - if no such module is registered.
See Also:
for a type-safer method to get module instances

getModuleInstance

<T> T getModuleInstance(Class<T> moduleClass)
Returns the module's instance. This is useful for modules of known type.

Throws:
IllegalArgumentException - if no such module is registered or if multiple modules are registered for this class.

getVersionHandler

ModuleVersionHandler getVersionHandler(String name)
Throws:
IllegalArgumentException - if no such module is registered.

getDefinition

ModuleDefinition getDefinition(String name)
Throws:
IllegalArgumentException - if no such module is registered.

getModuleNames

Set<String> getModuleNames()
Returns the names of configured modules.

Returns:
unmodifiable set of module names

getModuleDefinitions

List<ModuleDefinition> getModuleDefinitions()
Returns the list of known ModuleDefinitions, as ordered by the loading mechanism (typically in dependency order).

Since:
4.5


Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.