info.magnolia.module
Class ModuleManagerImpl

java.lang.Object
  extended by info.magnolia.module.ModuleManagerImpl
All Implemented Interfaces:
ModuleManager

public class ModuleManagerImpl
extends Object
implements ModuleManager

TODO where do we setup ModuleRegistry ? TODO : factor out into simpler units.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface info.magnolia.module.ModuleManager
ModuleManager.Factory, ModuleManager.ModuleAndDeltas, ModuleManager.ModuleManagementState
 
Constructor Summary
  ModuleManagerImpl()
           
protected ModuleManagerImpl(InstallContextImpl installContext, ModuleDefinitionReader moduleDefinitionReader)
           
protected ModuleManagerImpl(InstallContextImpl installContext, ModuleDefinitionReader moduleDefinitionReader, ModuleRegistry moduleRegistry, DependencyChecker dependencyChecker)
           
 
Method Summary
protected  void applyDeltas(ModuleDefinition moduleDef, List<Delta> deltas, InstallContextImpl ctx)
          Applies to given deltas for the given module.
 void checkForInstallOrUpdates()
          In addition to checking for install or updates, this method also loads repositories when there are no pending install or update tasks.
protected  void executeStartupTasks()
          Process startup tasks.
 InstallContext getInstallContext()
           
 ModuleManager.ModuleManagementState getStatus()
          Returns the status as discovered by checkForInstallOrUpdates().
 ModuleManagerUI getUI()
           
protected  void installOrUpdateModule(ModuleManager.ModuleAndDeltas moduleAndDeltas, InstallContextImpl ctx)
           
 List<ModuleDefinition> loadDefinitions()
          Loads modules definitions, validates dependencies and sorts modules by dependencies.
protected  ModuleVersionHandler newVersionHandler(ModuleDefinition module)
           
 void performInstallOrUpdate()
           
protected  void populateModuleInstance(Object moduleInstance, Map<String,Object> moduleProperties)
           
protected  void startModule(Object moduleInstance, ModuleDefinition moduleDefinition, ModuleLifecycleContextImpl lifecycleContext)
           
 void startModules()
           
protected  void stopModule(Object moduleInstance, ModuleDefinition moduleDefinition, ModuleLifecycleContextImpl lifecycleContext)
           
 void stopModules()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleManagerImpl

public ModuleManagerImpl()

ModuleManagerImpl

protected ModuleManagerImpl(InstallContextImpl installContext,
                            ModuleDefinitionReader moduleDefinitionReader)

ModuleManagerImpl

protected ModuleManagerImpl(InstallContextImpl installContext,
                            ModuleDefinitionReader moduleDefinitionReader,
                            ModuleRegistry moduleRegistry,
                            DependencyChecker dependencyChecker)
Method Detail

loadDefinitions

public List<ModuleDefinition> loadDefinitions()
                                       throws ModuleManagementException
Description copied from interface: ModuleManager
Loads modules definitions, validates dependencies and sorts modules by dependencies.

Specified by:
loadDefinitions in interface ModuleManager
Throws:
ModuleManagementException

checkForInstallOrUpdates

public void checkForInstallOrUpdates()
In addition to checking for install or updates, this method also loads repositories when there are no pending install or update tasks.

Specified by:
checkForInstallOrUpdates in interface ModuleManager
See Also:
ModuleManager.checkForInstallOrUpdates()

getStatus

public ModuleManager.ModuleManagementState getStatus()
Description copied from interface: ModuleManager
Returns the status as discovered by checkForInstallOrUpdates().

Specified by:
getStatus in interface ModuleManager

getUI

public ModuleManagerUI getUI()
Specified by:
getUI in interface ModuleManager

newVersionHandler

protected ModuleVersionHandler newVersionHandler(ModuleDefinition module)

performInstallOrUpdate

public void performInstallOrUpdate()
Specified by:
performInstallOrUpdate in interface ModuleManager

getInstallContext

public InstallContext getInstallContext()
Specified by:
getInstallContext in interface ModuleManager

startModules

public void startModules()
Specified by:
startModules in interface ModuleManager

executeStartupTasks

protected void executeStartupTasks()
Process startup tasks. Tasks retured by ModuleDefinition.getStartupTasks() are always executed and do not require manual intervention.


startModule

protected void startModule(Object moduleInstance,
                           ModuleDefinition moduleDefinition,
                           ModuleLifecycleContextImpl lifecycleContext)

stopModule

protected void stopModule(Object moduleInstance,
                          ModuleDefinition moduleDefinition,
                          ModuleLifecycleContextImpl lifecycleContext)

populateModuleInstance

protected void populateModuleInstance(Object moduleInstance,
                                      Map<String,Object> moduleProperties)

stopModules

public void stopModules()
Specified by:
stopModules in interface ModuleManager

installOrUpdateModule

protected void installOrUpdateModule(ModuleManager.ModuleAndDeltas moduleAndDeltas,
                                     InstallContextImpl ctx)

applyDeltas

protected void applyDeltas(ModuleDefinition moduleDef,
                           List<Delta> deltas,
                           InstallContextImpl ctx)
Applies to given deltas for the given module. It is NOT responsible for setting the given module as being the current module in the given context, but it is responsible for unsetting it when done, and for saving upon success.



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