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