info.magnolia.module
Class ModuleRegistryImpl

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

public class ModuleRegistryImpl
extends 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(String name)
           
<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)
           
 
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(String name,
                                     ModuleDefinition moduleDefinition)
Specified by:
registerModuleDefinition in interface ModuleRegistry

registerModuleInstance

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

registerModuleVersionHandler

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

isModuleRegistered

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

getDefinition

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

getModuleInstance

public Object getModuleInstance(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(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(String name)
Specified by:
getVersionHandler in interface ModuleRegistry

getModuleNames

public Set<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.