Properties-objects which consist of
key-value pairs. The configuration for a component is provided as a parameter of
the component constructor. The contents of the configuration is up to the
component itself. Therefore it should be documented as precisely as possible. In
any case it should depict
Properties-objects, they are stored in
corresponding configuration files. To extend flexibility, every component
(instance or type, c.f.
type and instance configuration) can have its own configuration file. If
this is the case, the path to this configuration file has to be stored in the
corresponding registry (root) configuration. <InstanceName>.ConfigFile = <RelativePathOfConfigFile> # configuration for type "ProcessManager" (configuration for anonymous # instance and default configuration for all process manager-instances) ProcessManager.ConfigFile = ProcessManager.properties # configuration for (process manager) instance "PM1" PM1.ConfigFile = pm1.properties # configuration for (data manager) instance "DM1" in separate directory DM1.ConfigFile = ./datamanager/data.properties
Configurations for components can also be stored directly in the root
configuration. In this case the corresponding property
(<ComponentType>.ConfigFile = <RelativePathOfConfigFile>)
has to be omitted. Instead, all properties for the component have to be
prefixed by the corresponding type name (for the component type and the
anonymous instance) or
prefixed by the corresponding instance name.
<InstanceName>.ConfigFile = <RelativePathOfConfigFile> # configuration for type "ProcessManager" in root configuration ProcessManager.MaxTemplates = 1000 ProcessManager.MaxInstances = 100000 # configuration for (process manager) instance "PM1" in root configuration PM1.MaxTemplates = 500The prefixes are removed before the configuration is handed over to the component. The names of the properties after the prefix are user-defined except the configuration needed for the registry.
Components.<ComponentType><ComponentType>.ImplementationInstances.<ComponentType><InstanceName>.Implementation# declaration of type "ProcessManager" Components.ProcessManager = de.aristaflow.adept2.core.processmanager.ProcessManager # implementation for anonymous instance of type "ProcessManager" ProcessManager.Implementation = de.aristaflow.adept2.core.processmanager.transientprocessmanager.TransientProcessManager # declaration of instance "PM1" and "PM2" of type "ProcessManager" Instances.ProcessManager = PM1, PM2 # used implementation for "PM1" PM1.Implementation = de.aristaflow.adept2.core.processmanager.defaultimplementation.ProcessManager # PM2 uses the same implementation as the anonymous instance, no entry necessary # declaration of type "DataManager" Components.DataManager = de.aristaflow.adept2.core.datamanager.DataManager # implementation for anonymous instance of type "DataManager" DataManager.Implementation = de.aristaflow.adept2.core.datamanager.dbimplementation.DbDataManager # only the anonymous instance exists, no instance declarations necessary
500 for MaxTemplates from its own configuration and
100000 for MaxInstances from the type configuration. Properties-object, their prefixes are removed and
the created object is then transferred to the component constructor.
The component should check for the validity of the designated configuration in
the constructor and throw a
ConfigurationException if this is not the case. Otherwise failures
due to erroneous configurations may occur later when the cause is hard to find.
Properties
-instances. They provide a simple mechanism for default-values: Every
Properties-instance can refer to another Properties
-instance which is used as default. If a key-value-pair is not found in
the referring Properties-instance, the request will be forwarded to the
referred (default) Properties-instance. Properties)
system configurations which overwrite default configurations. The configurations
are searched in the following directories:
de/aristaflow/adept2/core/configuration/
relative to the classpath of the used Java Virtual Machine.-Darflow.confdir=...
in the provided order (without overwriting) orconf/ in the current directory if no
configuration directories are provided via command line..adept2 relative to the home-directory of the
current user.