public void initializeComponentFactory(ComponentTypeDescription desc, Element metadata) throws ConfigurationException {
Element[] provides = metadata.getElements("provides");
for (int i = 0; i < provides.length; i++) {
String action = provides[i].getAttribute("action");
if (action == null) {
throw new ConfigurationException("Invalid composition service providing : no specified action");
} else if (action.equalsIgnoreCase("implement")) {
String spec = provides[i].getAttribute("specification");
if (spec == null) {
throw new ConfigurationException("Malformed provides : the specification attribute is mandatory");
} else {
desc.addProvidedServiceSpecification(spec);
}
} else if (action.equalsIgnoreCase("export")) {
String spec = provides[i].getAttribute("specification");
if (spec == null) {
throw new ConfigurationException("Malformed exports - Missing the specification attribute");
} else {
desc.addProvidedServiceSpecification(spec);
}
} else {
throw new ConfigurationException("Invalid composition service providing : unknown action " + action);
}
}
}