|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.abstractcontent.SubconfImpl
public class SubconfImpl
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.
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.
SubconfImpl.AbstractSubconfiguration.getPath(java.lang.String) is somewhat debatable, its
acceptance of a default value is subject to disappear. The notion of file for
a Path is also a problem as it will, for sure, break on other OSs than
on Unices. A move towards URL is planned.SubconfImpl.AbstractSubconfiguration.getPath(java.lang.String) arose in a need to provide
file and directory-paths for all ActiveMath components in a more-or-less transparent
fashion. We may replace it by a kind of file-attributor which is partly
independent of the Subconfiguration interface (e.g. could be a service).
The comfort of being able to specify inActiveMathHome, inTemp
or absolute is something to be considered for a next 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 |
|---|
public SubconfImpl()
| Method Detail |
|---|
public static void setCurrentConfig(Subconfiguration config)
public static Subconfiguration getCurrentConfig()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||