org.activemath.abstractcontent
Class SubconfImpl

java.lang.Object
  extended by org.activemath.abstractcontent.SubconfImpl

public class SubconfImpl
extends Object

This class is a simple wrapper for its static inner classes meant to provide useful implementations of the SubconfImpl.AbstractSubconfiguration interface. This class is nothing else than a package in a file.

Debates about Subconfiguration issues

The mechanismto to configure ActiveMath and its components is somewhat controversial. It first started with a simple property-file, being the simplest to parse and access. Progressively, a;; these properties were access through static calls to the Manager, these calls being, schematically what the current SubconfImpl.AbstractSubconfiguration performs: extraction of properties, extraction of derived values of them (files, int, ...).

The SubconfImpl.AbstractSubconfiguration interface has been introduced so as to allow parts integrated with ActiveMath to be released independently. It started with the OmdocJdom package whose components (mostly MBase-related) can then be configured with any implementation of the Subconfiguration interface including one built from a properties file as with classes here.

When considering the configuration of most other server software is based on XML files. This is the case of the Tomcat server, it is also the preferred configuration mechanism of the Avalon component framework which would be more than idea for the component lifecycle management.
XML files, however, have a great limitation: they do not, by default, allow overriding.

In ActiveMath, overriding is performed in several steps and key-value pairs as encoded in properties allow this in an elementary fashion: you simply redfine the property (there is no removal possible though). As of this writing, in ActiveMath, conf/ActiveMath-individual.properties overrides the content-descriptions which override conf/ActiveMath-individual.properties which overrides the class-loader org/activemath/config/Manager.properties. Overriding is important to ensure that installers actually do not loose or corrupt configuration delivered with the servers. It is also suitable for distributed configurations where each user can then override the configuration in their properties file.

In summary, the classes of this class and the subconfiguration interface are somewhat outsider solutions waiting for something better that can provide overriding. Presumably an XML-file based configuration modified by an XUpdate would present the perfect configuration solution.

Other plans about Subconfiguration

Version:

Nested Class Summary
static class SubconfImpl.AbstractSubconfiguration
          This provides a raw base providing no services and no string-properties
static class SubconfImpl.ChildSubconfiguration
          A class to provide property-subtree-based configuration defined by a prefix and a parent subconfiguration.
static class SubconfImpl.Log
          A simple wrapper for logging facilities... meant mostly to be worked from within the code of the SubconfImpl inner classes.
static interface SubconfImpl.PathResolver
          An interface to denote the capability to resolve paths so as to be able to provide URL objects from property values.
static class SubconfImpl.PropertiesConfig
          This class provides the subconfiguration facilities provided by a property file and to create services on a property-file based configuration.
static class SubconfImpl.UnionSubconfiguration
          A subcoonfiguration merging two subconfigurations.
static class SubconfImpl.Util
           
 
Constructor Summary
SubconfImpl()
           
 
Method Summary
static Subconfiguration getCurrentConfig()
          Gets the current Subconfiguration in the thead-local or null.
static void setCurrentConfig(Subconfiguration config)
          Sets the current Subconfiguration in the thead-local.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubconfImpl

public SubconfImpl()
Method Detail

setCurrentConfig

public static void setCurrentConfig(Subconfiguration config)
Sets the current Subconfiguration in the thead-local. Very useful to create your object with the given subconfig, then set it to some child, and configure your child, then bring it back.


getCurrentConfig

public static Subconfiguration getCurrentConfig()
Gets the current Subconfiguration in the thead-local or null. Very useful to create your object with the given subconfig, then set it to some child, and configure your child, then bring it back.