if(defaults == null)
throw new IllegalStateException("defaults cannot be null");
for(String key : defaults.keySet())
{
ContainerConfigurationMetaData md = defaults.get(key);
// Allow the configuration to inherit from a standard
// configuration. This is determined by looking for a
// configuration matching the name given by the extends
// attribute, or if extends was not specified, an
// existing configuration with the same.
ContainerConfigurationMetaData parent = null;
String extendsName = md.getExtendsName();
if (extendsName != null)
{
// Look first for another non-default parent
parent = merged.get(extendsName);
if (parent == null)
parent = defaults.get(extendsName);
if (parent == null)
throw new IllegalStateException("Failed to find parent configuration: "+extendsName+" among: "+defaults.keySet());
}
/* this probably doesn't make sense for defaults
since it would mean that the defaults contained
containers with the same names
else
{
parent = merged.get(key);
}
*/
md = new ContainerConfigurationMetaDataWrapper(md, parent);
merged.put(key, md);
}
if(primary != null)
{
for (String key : primary.keySet())
{
ContainerConfigurationMetaData md = primary.get(key);
// Allow the configuration to inherit from a standard
// configuration. This is determined by looking for a
// configuration matching the name given by the extends
// attribute, or if extends was not specified, an
// existing configuration with the same.
ContainerConfigurationMetaData parent = null;
String extendsName = md.getExtendsName();
if (extendsName != null)
{
parent = primary.get(extendsName);