ch.elca.el4j.core.io.support
Class AbstractOrderedConfigLocationProvider

java.lang.Object
  extended by ch.elca.el4j.core.io.support.AbstractOrderedConfigLocationProvider
All Implemented Interfaces:
ConfigLocationProvider
Direct Known Subclasses:
ManifestOrderedConfigLocationProvider

public abstract class AbstractOrderedConfigLocationProvider
extends Object
implements ConfigLocationProvider

This class simplifies writing ordered configuration location providers.

Author:
Andreas Bur (ABU)
File-location:
AbstractOrderedConfigLocationProvider
Last check-in date:
2009-08-04 13:59:45 +0200 (Di, 04. Aug 2009) by swismer for revision 3873

Constructor Summary
AbstractOrderedConfigLocationProvider()
           
 
Method Summary
protected abstract  Module[] createModules()
           
protected  Module[] getSortedModules()
           
protected  Resource[] mergeConfigLocationResources(Module[] modules)
          Merges the configuration location resources of the provided list of modules, preserving the module's order.
protected  String[] mergeConfigLocations(Module[] modules)
          Merges the configuration locations of the provided list of modules, preserving the module's order.
 void setModuleSorter(ModuleSorter moduleSorter)
          Sets the module sorter used to compute the list of modules while preserving their hierarchical constraints.
protected  Module[] sortModules(Module[] modules)
          Sorts an unordered list of modules using the hierarchical constraints defined across the modules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.elca.el4j.core.io.support.ConfigLocationProvider
getConfigLocationResources, getConfigLocations
 

Constructor Detail

AbstractOrderedConfigLocationProvider

public AbstractOrderedConfigLocationProvider()
Method Detail

setModuleSorter

public void setModuleSorter(ModuleSorter moduleSorter)
Sets the module sorter used to compute the list of modules while preserving their hierarchical constraints. Default sorter is a DefaultModuleSorter.

Parameters:
moduleSorter - The module sorter to use.
See Also:
ModuleSorter

getSortedModules

protected Module[] getSortedModules()
                             throws IOException
Returns:
Returns the sorted list of modules.
Throws:
IOException - On any io problem while working with modules.

createModules

protected abstract Module[] createModules()
                                   throws IOException
Returns:
Returns the created list of modules.
Throws:
IOException - On any io problem while module creation.

sortModules

protected Module[] sortModules(Module[] modules)
Sorts an unordered list of modules using the hierarchical constraints defined across the modules.

Parameters:
modules - The list of modules to sort.
Returns:
Returns an ordered list of modules that fulfill the partial order defined by the module's hierarchical constraints.

mergeConfigLocations

protected String[] mergeConfigLocations(Module[] modules)
Merges the configuration locations of the provided list of modules, preserving the module's order.

Parameters:
modules - The ordered list of modules which configuration locations has to be merged.
Returns:
Returns the ordered list of configuration locations declared by the modules. Most specific location comes first.

mergeConfigLocationResources

protected Resource[] mergeConfigLocationResources(Module[] modules)
Merges the configuration location resources of the provided list of modules, preserving the module's order.

Parameters:
modules - The ordered list of modules which configuration location resources has to be merged.
Returns:
Returns the ordered list of configuration location resources declared by the modules. Most specific location comes first.


Copyright © 2005-2011 ELCA. All Rights Reserved.