use of org.osgi.service.blueprint.reflect.ReferenceListMetadata in project aries by apache.
the class AbstractParserProxy method parseCDRForReferences.
/**
* Extract References metadata from a ComponentDefinitionRegistry.
* @param cdr ComponentDefinitionRegistry
* @return List<WrappedReferenceMetadata>
* @throws InvalidAttributeException
*/
private List<ImportedService> parseCDRForReferences(ComponentDefinitionRegistry cdr) throws InvalidAttributeException {
_logger.debug(LOG_ENTRY, "parseCDRForReferences", new Object[] { cdr });
List<ImportedService> result = new ArrayList<ImportedService>();
for (ComponentMetadata compMetadata : findAllComponents(cdr)) {
if (compMetadata instanceof ServiceReferenceMetadata) {
ServiceReferenceMetadata referenceMetadata = (ServiceReferenceMetadata) compMetadata;
boolean optional = referenceMetadata.getAvailability() == ServiceReferenceMetadata.AVAILABILITY_OPTIONAL;
String iface = referenceMetadata.getInterface();
String compName = referenceMetadata.getComponentName();
String blueprintFilter = referenceMetadata.getFilter();
String id = referenceMetadata.getId();
boolean isMultiple = (referenceMetadata instanceof ReferenceListMetadata);
// For now we blacklist certain objectClasses and filters - this is a pretty dreadful thing to do.
if (!isBlacklisted(iface, blueprintFilter)) {
ImportedService ref = _modellingManager.getImportedService(optional, iface, compName, blueprintFilter, id, isMultiple);
result.add(ref);
}
}
}
_logger.debug(LOG_EXIT, "parseCDRForReferences", new Object[] { result });
return result;
}
Aggregations