RuntimeRegistry), a registry for server components, one for
model factories. All of these handle components but differ in some supported
functions. They are organised in a class hierarchy in which the higher
registries are more generic than registries down the hierarchy.
This is all done via the corresponding registry configuration. Just like the plugin declarations, the component types need to be registered, the component instances have to be declared as well as the usage relations. See the example below.
Components.<ComponentType> and
<ComponentType>.Implementation
the corresponding interface and one implementation are registered for a
component. Additionally one can specify:
<ComponentType>.InstantiationModeOFF, SINGLETON
or MULTIPLE. If set to MULTIPLE, every request for a
component instance returns a new object instance. This implies having
multiple object instances with the same component instance name.<ComponentType>.<UsedComponentType>Instances.<ComponentType>
for several instance names and
<InstanceName>.Implementation
for specifying the corresponding implementing classes. As for component
types, instantiation mode and used components may be specified for every
(using) component instance:
<InstanceName>.InstantiationMode<InstanceName>.<UsedComponentType><InstanceName>.<UsedComponentType>
does not exist, the property for the anonymous instance of the using
component will be checked
(<ComponentType>.<UsedComponentType>). If this does also
not exist, the anonymous type of the used instance will be
used.# 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" 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 # used data manager instance for anonymous instance of type "ProcessManager" ProcessManager.DataManager = DM1 # PM1 uses the same data manager as the anonymous instance of type "ProcessManager", no entry necessary # used data manager instance for "PM2" PM2.DataManager = DM2 # used log manager for instance "PM1" PM1.LogManager = LM1 # the anonymous instance as well as PM2 use both the anonymous instance of the log manager, 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.SQLDataManager # declaration of instance "DM1" of type "DataManager" Instances.DataManager = DM1 # used implementation for "DM1" DM1.Implementation = de.aristaflow.adept2.core.datamanager.dbimplementation.DbDataManager # used log manager instance for "DM1" DM1.LogManager = LM2 # declaration of type "LogManager" Components.LogManager = de.aristaflow.adept2.core.logmanager.LogManager # implementation for anonymous instance of type "DataManager" LogManager.Implementation = de.aristaflow.adept2.core.logmanager.defaultimplementation.DefaultLogManager # declaration of instances "LM1" and "LM2" of type "LogManager" Instances.LogManager = LM1, LM2 # used implementation for "LM1" LM1.Implementation = de.aristaflow.adept2.core.logmanager.database.DBLogManager # used implementation for "LM2" LM2.Implementation = de.aristaflow.adept2.core.logmanager.file.FileLogger
PM1 will retrieve the data manager DM1 by simply calling
ServerRegistry.getDataManager("/ProcessManager/PM1"). This way, plugins
are used mainly for retrieving dynamically set component instances, for
instance, a worklist manager retrieves a specific escalation handling from the
corresponding worklist item. If this dynamic is not needed, defining the
usage relation in the configuration will be easier to use for the component.
String) and a configuration (Properties)
as parameters. A component has to provide an appropriate constructor.
The registry (resp. the underlying ConfigurationManager) takes care of
the configuration for an instantiated component. Thus, a registry encapsulates
the instantiation and the configuration of a component. A component only needs
to parse its configuration.
ServiceRegistry. This works
only with components supporting these sophisticated features
(de.aristaflow.adept2.base.service.ADEPT2Service). Boot.properties.