net.ontopia.topicmaps.webed.impl.utils
Class ActionConfigurator

java.lang.Object
  extended by net.ontopia.topicmaps.webed.impl.utils.ActionConfigurator
All Implemented Interfaces:
ConfigurationObservableIF

public class ActionConfigurator
extends java.lang.Object
implements ConfigurationObservableIF

INTERNAL: Provide easy access for reading in an action configuration file and generating an action registry object from it. Automatic observation of file changes are performed


Field Summary
protected  java.lang.String contextPath
           
protected  long delay
           
protected  java.lang.String fileName
           
protected  boolean logErrors
           
protected  java.util.Collection observers
           
protected  java.lang.String realPath
           
protected  ActionRegistryIF registry
           
 
Constructor Summary
ActionConfigurator(java.lang.String contextPath, java.lang.String realPath, java.lang.String fileName)
          Constructor which allows to specify the path of the servlet context and the configuration file name.
ActionConfigurator(java.lang.String contextPath, java.lang.String realPath, java.lang.String fileName, long delay)
          See ActionConfigurator(String, String, String) with automatic observation for changes of the configuration file.
 
Method Summary
 void addObserver(ConfigurationObserverIF o)
          Adds an observer to the set of observers for this object.
 java.lang.String getFileName()
           
 ActionRegistryIF getRegistry()
           
 void logErrors(boolean logErrors)
           
protected  void notifyObserversConfigurationChanged()
          Loops through and notifies each observer if a new item was detected.
 void readAndWatchRegistry()
           
 void readRegistryConfiguration()
          Reads in configuration file and try to generate a action registry object.
 void removeObserver(ConfigurationObserverIF o)
          Removes an observer from the set of observers of this object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

contextPath

protected java.lang.String contextPath

realPath

protected java.lang.String realPath

fileName

protected java.lang.String fileName

delay

protected long delay

registry

protected ActionRegistryIF registry

observers

protected java.util.Collection observers

logErrors

protected boolean logErrors
Constructor Detail

ActionConfigurator

public ActionConfigurator(java.lang.String contextPath,
                          java.lang.String realPath,
                          java.lang.String fileName)
Constructor which allows to specify the path of the servlet context and the configuration file name. No further file change observations are executed.


ActionConfigurator

public ActionConfigurator(java.lang.String contextPath,
                          java.lang.String realPath,
                          java.lang.String fileName,
                          long delay)
See ActionConfigurator(String, String, String) with automatic observation for changes of the configuration file.

Parameters:
delay - - The delay in milliseconds between file change observations.
Method Detail

logErrors

public void logErrors(boolean logErrors)

readAndWatchRegistry

public void readAndWatchRegistry()

getFileName

public java.lang.String getFileName()

getRegistry

public ActionRegistryIF getRegistry()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addObserver

public void addObserver(ConfigurationObserverIF o)
Description copied from interface: ConfigurationObservableIF
Adds an observer to the set of observers for this object.

Specified by:
addObserver in interface ConfigurationObservableIF

removeObserver

public void removeObserver(ConfigurationObserverIF o)
Description copied from interface: ConfigurationObservableIF
Removes an observer from the set of observers of this object.

Specified by:
removeObserver in interface ConfigurationObservableIF

readRegistryConfiguration

public void readRegistryConfiguration()
Reads in configuration file and try to generate a action registry object.


notifyObserversConfigurationChanged

protected void notifyObserversConfigurationChanged()
Loops through and notifies each observer if a new item was detected.



Copyright © 2000-2012 Ontopia.