use of org.apache.felix.ipojo.composite.service.instantiator.SvcInstance in project felix by apache.
the class ProvidedServiceHandler method computeAvailableServices.
/**
* Build the list of available specifications.
*/
private void computeAvailableServices() {
// Get instantiated services :
ServiceDependencyHandler handler = (ServiceDependencyHandler) getHandler(HandlerFactory.IPOJO_NAMESPACE + ":subservice");
for (int i = 0; handler != null && i < handler.getInstances().size(); i++) {
SvcInstance svc = (SvcInstance) handler.getInstances().get(i);
String itf = svc.getServiceSpecification();
boolean agg = svc.isAggregate();
boolean opt = svc.isOptional();
SpecificationMetadata specMeta = new SpecificationMetadata(itf, m_context, agg, opt, this);
m_services.add(specMeta);
}
for (int i = 0; handler != null && i < handler.getRequirements().size(); i++) {
ServiceImporter imp = (ServiceImporter) handler.getRequirements().get(i);
String itf = imp.getSpecification().getName();
boolean agg = imp.isAggregate();
boolean opt = imp.isOptional();
SpecificationMetadata specMeta = new SpecificationMetadata(itf, m_context, agg, opt, this);
m_services.add(specMeta);
}
}
Aggregations