use of org.osgi.service.component.annotations.ReferenceCardinality in project bnd by bndtools.
the class DSAnnotations method addServiceRequirement.
private void addServiceRequirement(ReferenceDef ref, MergedRequirement requires) {
String objectClass = ref.service;
ReferenceCardinality cardinality = ref.cardinality;
boolean optional = cardinality == ReferenceCardinality.OPTIONAL || cardinality == ReferenceCardinality.MULTIPLE;
boolean multiple = cardinality == ReferenceCardinality.MULTIPLE || cardinality == ReferenceCardinality.AT_LEAST_ONE;
String filter = "(objectClass=" + objectClass + ")";
requires.put(filter, "active", optional, multiple);
}
Aggregations