private void parseReference(ComponentDefinition<Implementation<?>> componentDefinition, AbstractComponentType<?, ?, ?, ?> componentType, XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException, UnrecognizedElementException { ComponentReference reference; reference = registry.load(reader, ComponentReference.class, context); if (reference == null) { // there was an error with the reference configuration, just skip it return; } if (!componentType.hasReference(reference.getName())) { // ensure the reference exists ComponentReferenceNotFound failure = new ComponentReferenceNotFound(reference.getName(), componentDefinition, reader); context.addError(failure); return; } String refKey = reference.getName(); if (componentDefinition.getReferences().containsKey(refKey)) { DuplicateComponentReference failure = new DuplicateComponentReference(refKey, componentDefinition.getName(), reader); context.addError(failure); } else { componentDefinition.add(reference); } }
private void parseProperty(ComponentDefinition<Implementation<?>> componentDefinition, AbstractComponentType<?, ?, ?, ?> componentType, XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException, UnrecognizedElementException { PropertyValue value; value = registry.load(reader, PropertyValue.class, context); if (value == null) { // there was an error with the property configuration, just skip it return; } if (!componentType.hasProperty(value.getName())) { // ensure the property exists ComponentPropertyNotFound failure = new ComponentPropertyNotFound(value.getName(), componentDefinition, reader); context.addError(failure); return; } if (componentDefinition.getPropertyValues().containsKey(value.getName())) { String id = value.getName(); DuplicateConfiguredProperty failure = new DuplicateConfiguredProperty(id, componentDefinition, reader); context.addError(failure); } else { componentDefinition.add(value); } }
private void parseService(ComponentDefinition<Implementation<?>> componentDefinition, AbstractComponentType<?, ?, ?, ?> componentType, XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException, UnrecognizedElementException { ComponentService service; service = registry.load(reader, ComponentService.class, context); if (service == null) { // there was an error with the service configuration, just skip it return; } if (!componentType.hasService(service.getName())) { // ensure the service exists ComponentServiceNotFound failure = new ComponentServiceNotFound(service.getName(), componentDefinition, reader); context.addError(failure); return; } if (componentDefinition.getServices().containsKey(service.getName())) { String id = service.getName(); DuplicateComponentService failure = new DuplicateComponentService(id, componentDefinition.getName(), reader); context.addError(failure); } else { componentDefinition.add(service); } }