org.jwarp.service.configuration
Class AConfiguration

java.lang.Object
  |
  +--org.jwarp.service.configuration.AConfiguration
All Implemented Interfaces:
IConfiguration
Direct Known Subclasses:
FileConfiguration

public abstract class AConfiguration
extends java.lang.Object
implements IConfiguration

Base configuration class implementing the file configuration interface.

Version:
1.0
Author:
Martin Schaefer, Anatole Tresch

Field Summary
protected  boolean checkModification
          Check for modification or not before accessing the config
protected  org.jdom.Document document
          The JDOM document
protected  long lastModified
          last modified date
 
Fields inherited from interface org.jwarp.service.configuration.IConfiguration
ELEM_CONFIG
 
Constructor Summary
AConfiguration()
          Creates a configuration.
AConfiguration(boolean checkModification)
          Creates a configuration.
 
Method Summary
 org.jdom.Document getDocument()
          Return the JDOM document of this configuration.
 org.jdom.Element getRootElement()
          Return the JDOM root element of this configuration.
abstract  void initDocument()
          Sets the JDOM document of this configuration.
 boolean isCheckingModification()
          Returns true, if the Configuration is checked for modifications and reparsed if needed.
abstract  void reloadConfiguration()
          Reloads the JDOM document of this configuration.
 void setCheckingModification(boolean checkModification)
          Torn on/off if the Configuration should be checked for modifications and reparsed if needed.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

protected org.jdom.Document document
The JDOM document

lastModified

protected long lastModified
last modified date

checkModification

protected boolean checkModification
Check for modification or not before accessing the config
Constructor Detail

AConfiguration

public AConfiguration()
               throws ConfigurationException
Creates a configuration.

AConfiguration

public AConfiguration(boolean checkModification)
               throws ConfigurationException
Creates a configuration.
Method Detail

initDocument

public abstract void initDocument()
                           throws ConfigurationException
Sets the JDOM document of this configuration. If checkModification is enabled, the source document will be parsed if it has changed before the document is returned. This method must be overridden by the subclasses.

reloadConfiguration

public abstract void reloadConfiguration()
                                  throws ConfigurationException
Reloads the JDOM document of this configuration. If checkModification is enabled, the source document will be reloaded. This method must be overridden by the subclasses.

getDocument

public org.jdom.Document getDocument()
                              throws ConfigurationException
Return the JDOM document of this configuration. If checkModification is enabled, the source document will be parsed if it has changed before the document is returned. This method must be overridden by the subclasses.
Specified by:
getDocument in interface IConfiguration

getRootElement

public org.jdom.Element getRootElement()
                                throws ConfigurationException
Return the JDOM root element of this configuration. If checkModification is enabled, the source document will be parsed if it has changed before the root element is returned.
Specified by:
getRootElement in interface IConfiguration

isCheckingModification

public boolean isCheckingModification()
Returns true, if the Configuration is checked for modifications and reparsed if needed.
Specified by:
isCheckingModification in interface IConfiguration

setCheckingModification

public void setCheckingModification(boolean checkModification)
Torn on/off if the Configuration should be checked for modifications and reparsed if needed.
Specified by:
setCheckingModification in interface IConfiguration
Parameters:
checkModification - If set to true, the modifications will be checked.

©   O R C A   S y s t e m s