Container Configuration
The Container Configuration File is used to bootstrap the YAAFI container. This file is optional and only used if you either want full control over the container configuration or would like to use advanced features such as global interceptors of fallback service managers.
Specification
Item | Datatype | Cardinality | Description |
---|---|---|---|
containerType | String | [0|1] | The type of Avalon container where YAAFI is instantiated, either "phoenix", "fortress" or "merlin". If no value is defined then merlin will be used. This parameter is only relevant if you embed YAAFI into another Avalon container. |
containerClazzName | String | [0|1] | The class name of the YAAFI container to be instantiated. This feature allows to use inheritance for customizing the container functionality. |
componentRoles | Tree | [0|1] | Information about the role configuration file |
componentRoles/location | String | [0|1] | The location of the component role file |
componentRoles/isEncrypted | String | [0|1] | Is the component role file encrypted? The possible values are ["true"|"false"|"auto"] |
componentConfiguration | Tree | [0|1] | Information about the component configuration file |
componentConfiguration/location | String | [0|1] | The location of the component configuration file |
componentConfiguration/isEncrypted | String | [0|1] | Is the component configuration file encrypted? The possible values are ["true"|"false"|"auto"] |
componentConfigurationProperties | Tree | [0|1] | Information about the component configuration proeprties used to resolve variables in the componentConfiguration |
componentConfigurationProperties/location | String | [0|1] | The location of the component configuration property file. The default value is "/componentConfiguration.properties" |
componentConfigurationProperties/resolver | String | [0|1] | The fully-qualified name of a class implementing "ComponentConfigurationPropertiesResolver". An instance of this class is created to support custom property resolvers such as commons-configuration integration. |
parameters | Tree | [0|1] | Information about the parameters file |
parameters/location | String | [0|1] | The location of the parameters file |
parameters/isEncrypted | String | [0|1] | Is the parameters file encrypted? The possible values are ["true"|"false"|"auto"] |
hasDynamicProxies | Boolean | [true|false] | Enable the usage of dynamic proxies for the whole container. When the no dynamic proxies are used no interceptors will be installed. This is a quick way to disable a interceptors without touching the remaining configuration (e.g. enable interceptors for execution time profiling during intergration testing). |
interceptors | Tree | [0|1] | Contains a list of container specific interceptors |
interceptors/interceptor | String | [0..n] | Contains the service name of an interceptor |
serviceManagers | Tree | [0|1] | Contains a list of fallback service managers used to expose additional servcices not managed by the Avalon container. |
serviceManager | String | 1 | The name of a service implementing the "ServiceManager" interface. The service lookup is used to locate service not managed by by the Avalon container. This allows to transparently integrate other service framework such as Spring. |
Example 1
A plain vanilla container configuration defining the location of all configuration files. It is assumed that the configuration files are not encrypted.
<fulcrum-yaafi> <componentRoles> <location>./src/test/TestRoleConfig.xml</location> </componentRoles> <componentConfiguration> <location>./src/test/TestComponentConfig.xml</location> </componentConfiguration> <parameters> <location>./src/test/TestParameters.properties</location> </parameters> </fulcrum-yaafi>
Example 2
This container configuration defines the location of the component role and component configuration files. Furthermore it adds two interceptors to all managed services.
<fulcrum-yaafi> <componentRoles> <location>./src/test/componentRoles.xml</location> </componentRoles> <componentConfiguration> <location>./src/test/componentConfiguration.xml</location> </componentConfiguration> <interceptors> <interceptor>org.apache.fulcrum.yaafi.interceptor.performance.PerformanceInterceptorService</interceptor> <interceptor>org.apache.fulcrum.yaafi.interceptor.logging.LoggingInterceptorService</interceptor> </interceptors> </fulcrum-yaafi>
Example 3
This container configuration defines the location of the component role and component configuration files. Furthermore it defines a fallback service manager to lookup services managed by the Spring framework.
<fulcrum-yaafi> <componentRoles> <location>./src/test/springIntoAvalonComponentRoles.xml</location> </componentRoles> <componentConfiguration> <location>./src/test/springIntoAvalonComponentConfiguration.xml</location> </componentConfiguration> <serviceManagers> <serviceManager>springFrameworkService</serviceManager> </serviceManagers> </fulcrum-yaafi>