org.moremotion.config
Class ConfigManager

java.lang.Object
  extended by org.moremotion.config.ConfigManager
All Implemented Interfaces:
java.lang.Runnable

public class ConfigManager
extends java.lang.Object
implements java.lang.Runnable

ConfigManager detects the changes in the configuration files under "WEB-INF/MM-INF/config" directory and loads the first level elements in the file as ConfigUnit objects and lets the ConfigCache store them.

Version:
$Id: ConfigManager.java 825 2011-03-01 08:41:38Z erkan $

Constructor Summary
ConfigManager(java.io.File root)
          Creates a new instance of ConfigManager
ConfigManager(java.io.File root, java.lang.String pageRoot, boolean assistingToMMAS)
           
 
Method Summary
 boolean busy()
           
static ConfigUnit extractConfigUnit(java.io.File cf, java.lang.String unitType, java.lang.String unitName)
           
static ConfigUnit fetchConfigUnitFromOtherContext(java.lang.String uri, java.lang.String unitType, java.lang.String unitName)
           
 void finalize()
           
static Config getConfig(java.lang.String type, java.lang.String name)
           
static Config getConfig(java.lang.String type, java.lang.String name, java.lang.String originPage)
           
 java.util.List getFileListing(java.io.File startDir)
           
 java.lang.String getRefId(java.io.File f)
           
 void run()
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigManager

public ConfigManager(java.io.File root)
Creates a new instance of ConfigManager


ConfigManager

public ConfigManager(java.io.File root,
                     java.lang.String pageRoot,
                     boolean assistingToMMAS)
Method Detail

getConfig

public static Config getConfig(java.lang.String type,
                               java.lang.String name)
                        throws ConfigurationException
Throws:
ConfigurationException

getConfig

public static Config getConfig(java.lang.String type,
                               java.lang.String name,
                               java.lang.String originPage)
                        throws ConfigurationException
Throws:
ConfigurationException

start

public void start()

busy

public boolean busy()

run

public void run()
Specified by:
run in interface java.lang.Runnable

stop

public void stop()

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

getFileListing

public java.util.List getFileListing(java.io.File startDir)

getRefId

public java.lang.String getRefId(java.io.File f)

extractConfigUnit

public static ConfigUnit extractConfigUnit(java.io.File cf,
                                           java.lang.String unitType,
                                           java.lang.String unitName)
                                    throws ConfigurationException
Throws:
ConfigurationException

fetchConfigUnitFromOtherContext

public static ConfigUnit fetchConfigUnitFromOtherContext(java.lang.String uri,
                                                         java.lang.String unitType,
                                                         java.lang.String unitName)
                                                  throws ConfigurationException
Throws:
ConfigurationException


Copyright © 2002-2011 MOR YAZILIM. All Rights Reserved.