info.magnolia.module
Interface ModuleRegistry

All Known Implementing Classes:
ModuleRegistryImpl

public interface ModuleRegistry

Holds instances and definitions of modules.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Nested Class Summary
static class ModuleRegistry.Factory
          Use this to retrieve the configured singleton impl of ModuleRegistry.
 
Method Summary
 ModuleDefinition getDefinition(java.lang.String name)
           
<T> T
getModuleInstance(java.lang.Class<T> moduleClass)
          Returns the module's instance.
 java.lang.Object getModuleInstance(java.lang.String name)
          Returns the module's instance.
 java.util.Set<java.lang.String> getModuleNames()
          Returns the names of configured modules.
 ModuleVersionHandler getVersionHandler(java.lang.String name)
           
 boolean isModuleRegistered(java.lang.String name)
           
 void registerModuleDefinition(java.lang.String name, ModuleDefinition moduleDefinition)
           
 void registerModuleInstance(java.lang.String name, java.lang.Object moduleInstance)
           
 void registerModuleVersionHandler(java.lang.String name, ModuleVersionHandler moduleVersionHandler)
           
 

Method Detail

registerModuleDefinition

void registerModuleDefinition(java.lang.String name,
                              ModuleDefinition moduleDefinition)

registerModuleInstance

void registerModuleInstance(java.lang.String name,
                            java.lang.Object moduleInstance)

registerModuleVersionHandler

void registerModuleVersionHandler(java.lang.String name,
                                  ModuleVersionHandler moduleVersionHandler)

isModuleRegistered

boolean isModuleRegistered(java.lang.String name)

getModuleInstance

java.lang.Object getModuleInstance(java.lang.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:
java.lang.IllegalArgumentException - if no such module is registered.
See Also:
for a type-safer method to get module instances

getModuleInstance

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

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

getVersionHandler

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

getDefinition

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

getModuleNames

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

Returns:
unmodifiable set of module names


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