*
* @throws ResourceInitializationException
* if the configuration parameters are invalid
*/
protected void validateConfigurationParameters(ResourceManager aResourceManager) throws ResourceInitializationException {
ConfigurationParameterDeclarations cfgParamDecls = getMetaData()
.getConfigurationParameterDeclarations();
ConfigurationParameter[] params = cfgParamDecls.getConfigurationParameters();
if (params.length > 0) {
// check for duplicate names
checkForDuplicateParameterNames(params);
checkForInvalidParameterOverrides(params, null, aResourceManager);
} else {
ConfigurationParameter[] commonParams = cfgParamDecls.getCommonParameters();
// check for duplicates in common params
Set<String> commonParamNames = new HashSet<String>();
if (commonParams != null) {
for (int i = 0; i < commonParams.length; i++) {
if (!commonParamNames.add(commonParams[i].getName())) {
throw new ResourceInitializationException(
ResourceInitializationException.DUPLICATE_CONFIGURATION_PARAMETER_NAME,
new Object[] { commonParams[i].getName(), getMetaData().getName(),
commonParams[i].getSourceUrlString() });
}
}
}
// check for duplicates in groups
ConfigurationGroup[] groups = cfgParamDecls.getConfigurationGroups();
if (groups != null) {
Map<String, Set<String>> groupToParamSetMap = new HashMap<String, Set<String>>(); // map from group name to HashSet of param names
// in that group
for (int i = 0; i < groups.length; i++) {
String[] names = groups[i].getNames();