* @throws IOException creating the YAAFI configuration failed
*/
protected ServiceContainerConfiguration createServiceContainerConfiguration(
Configuration conf, String appRoot) throws IOException
{
ServiceContainerConfiguration result
= new ServiceContainerConfiguration();
result.setLogger(this.createAvalonLogger(AVALON_LOG_CATEGORY));
result.setApplicationRootDir(appRoot);
// are we using a "containerConfiguration.xml" ?!
if (conf.containsKey(CONTAINER_CONFIGURATION_KEY))
{
// determine the container configuration file
String containerConfiguration
= conf.getString(CONTAINER_CONFIGURATION_KEY);
result.loadContainerConfiguration(containerConfiguration);
}
else if (conf.containsKey(COMPONENT_ROLE_KEY))
{
// determine the location of the role configuration file
String roleConfigurationFileName
= conf.getString(COMPONENT_ROLE_KEY, COMPONENT_ROLE_VALUE);
// determine the location of component configuration file
String componentConfigurationFileName = conf.getString(
COMPONENT_CONFIG_KEY, COMPONENT_CONFIG_VALUE);
// determine the location of parameters file
String parametersFileName = conf.getString(
COMPONENT_PARAMETERS_KEY, COMPONENT_PARAMETERS_VALUE);
result.setComponentRolesLocation(roleConfigurationFileName);
result.setComponentConfigurationLocation(
componentConfigurationFileName);
result.setParametersLocation(parametersFileName);
}
else
{
// determine the container configuration file
String containerConfiguration = conf.getString(
CONTAINER_CONFIGURATION_KEY, CONTAINER_CONFIGURATION_VALUE);
result.loadContainerConfiguration(containerConfiguration);
}
return result;
}