private void indexImplementationPropertiesServicesAndReferences(Component component,
Map<String, Service> services,
Map<String, Reference> references,
Map<String, Property> properties) {
// First check that the component has a resolved implementation
Implementation implementation = component.getImplementation();
if (implementation == null) {
// A component must have an implementation
warning("No implementation for component: " + component.getName(), component);
} else if (implementation.isUnresolved()) {
// The implementation must be fully resolved
warning("Component implementation not found: " + component.getName()
+ " : "
+ implementation.getURI(), component);
} else {
// Index properties, services and references, also check for
// duplicates
for (Property property : implementation.getProperties()) {
if (properties.containsKey(property.getName())) {
warning("Duplicate property name: " + component.getName()
+ "/"
+ property.getName(), component);
} else {
properties.put(property.getName(), property);
}
}
for (Service service : implementation.getServices()) {
if (services.containsKey(service.getName())) {
warning("Duplicate service name: " + component.getName()
+ "/"
+ service.getName(), component);
} else {
services.put(service.getName(), service);
}
}
for (Reference reference : implementation.getReferences()) {
if (references.containsKey(reference.getName())) {
warning("Duplicate reference name: " + component.getName()
+ "/"
+ reference.getName(), component);
} else {