Search in sources :

Example 1 with SvcInstance

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);
    }
}
Also used : SvcInstance(org.apache.felix.ipojo.composite.service.instantiator.SvcInstance) ServiceImporter(org.apache.felix.ipojo.composite.service.instantiator.ServiceImporter) ServiceDependencyHandler(org.apache.felix.ipojo.composite.service.instantiator.ServiceDependencyHandler)

Aggregations

ServiceDependencyHandler (org.apache.felix.ipojo.composite.service.instantiator.ServiceDependencyHandler)1 ServiceImporter (org.apache.felix.ipojo.composite.service.instantiator.ServiceImporter)1 SvcInstance (org.apache.felix.ipojo.composite.service.instantiator.SvcInstance)1