info.magnolia.module
Class ModuleRegistryImpl

java.lang.Object
  extended by info.magnolia.module.ModuleRegistryImpl
All Implemented Interfaces:
ModuleRegistry

public class ModuleRegistryImpl
extends java.lang.Object
implements ModuleRegistry

Keeps references to module descriptors and instances.

Version:
$Id: ModuleRegistryImpl.java 41137 2011-01-06 18:19:25Z gjoseph $
Author:
philipp

Nested Class Summary
 
Nested classes/interfaces inherited from interface info.magnolia.module.ModuleRegistry
ModuleRegistry.Factory
 
Constructor Summary
ModuleRegistryImpl()
           
 
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleRegistryImpl

public ModuleRegistryImpl()
Method Detail

registerModuleDefinition

public void registerModuleDefinition(java.lang.String name,
                                     ModuleDefinition moduleDefinition)
Specified by:
registerModuleDefinition in interface ModuleRegistry

registerModuleInstance

public void registerModuleInstance(java.lang.String name,
                                   java.lang.Object moduleInstance)
Specified by:
registerModuleInstance in interface ModuleRegistry

registerModuleVersionHandler

public void registerModuleVersionHandler(java.lang.String name,
                                         ModuleVersionHandler moduleVersionHandler)
Specified by:
registerModuleVersionHandler in interface ModuleRegistry

isModuleRegistered

public boolean isModuleRegistered(java.lang.String name)
Specified by:
isModuleRegistered in interface ModuleRegistry

getDefinition

public ModuleDefinition getDefinition(java.lang.String name)
Specified by:
getDefinition in interface ModuleRegistry

getModuleInstance

public java.lang.Object getModuleInstance(java.lang.String name)
Description copied from interface: ModuleRegistry
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).

Specified by:
getModuleInstance in interface ModuleRegistry
See Also:
for a type-safer method to get module instances

getModuleInstance

public <T> T getModuleInstance(java.lang.Class<T> moduleClass)
Description copied from interface: ModuleRegistry
Returns the module's instance. This is useful for modules of known type.

Specified by:
getModuleInstance in interface ModuleRegistry

getVersionHandler

public ModuleVersionHandler getVersionHandler(java.lang.String name)
Specified by:
getVersionHandler in interface ModuleRegistry

getModuleNames

public java.util.Set<java.lang.String> getModuleNames()
Description copied from interface: ModuleRegistry
Returns the names of configured modules.

Specified by:
getModuleNames in interface ModuleRegistry
Returns:
unmodifiable set of module names


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