params[params.length - 1].setName(name);
params[params.length - 1].setValue((String) value);
spec.setParameters(params);
}
} else if (aSpec instanceof ResourceCreationSpecifier) {
ResourceMetaData md = ((ResourceCreationSpecifier) aSpec).getMetaData();
if (md.getConfigurationParameterDeclarations().getConfigurationParameter(null, name) == null) {
throw new IllegalArgumentException("Cannot set undeclared parameter [" + name + "]");
}
md.getConfigurationParameterSettings().setParameterValue(name, value);
} else if (aSpec instanceof ConfigurableDataResourceSpecifier) {
ResourceMetaData md = ((ConfigurableDataResourceSpecifier) aSpec).getMetaData();
if (md.getConfigurationParameterDeclarations().getConfigurationParameter(null, name) == null) {
throw new IllegalArgumentException("Cannot set undeclared parameter [" + name + "]");
}
md.getConfigurationParameterSettings().setParameterValue(name, value);
} else {
throw new IllegalClassException("Unsupported resource specifier class [" + aSpec.getClass()
+ "]");
}
}