Package org.apache.felix.ipojo.composite.service.instantiator

Examples of org.apache.felix.ipojo.composite.service.instantiator.ServiceImporter


            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);
        }
    }
View Full Code Here


            Object object = specField.get(null);
            if (object instanceof String) {
                Element specification = ManifestMetadataParser.parse((String) object);
                Element[] reqs = specification.getElements("requires");
                for (int j = 0; reqs != null && j < reqs.length; j++) {
                    ServiceImporter imp = getAttachedRequirement(reqs[j]);
                    if (imp != null) {
                        // Fix service-level dependency flag
                        imp.setServiceLevelDependency();
                    }
                    checkRequirement(imp, reqs[j]);
                }
            } else {
                error("[" + getCompositeManager().getInstanceName() + "] The specification field of the service specification " + svc.getSpecification() + " needs to be a String");
View Full Code Here

        String identity = element.getAttribute("id");
        if (identity != null) {
            // Look for dependency Id
            for (int i = 0; i < handler.getRequirements().size(); i++) {
                ServiceImporter imp = (ServiceImporter) handler.getRequirements().get(i);
                if (imp.getId().equals(identity)) { return imp; }
            }
        }

        // If not found or no id, look for a dependency with the same specification
        String requirement = element.getAttribute("specification");
        for (int i = 0; i < handler.getRequirements().size(); i++) {
            ServiceImporter imp = (ServiceImporter) handler.getRequirements().get(i);
            if (imp.getId().equals(requirement) || imp.getSpecification().getName().equals(requirement)) { return imp; }
        }
        return null;
    }
View Full Code Here

                specToImport = getCompositeManager().getGlobalContext().getBundle().loadClass(spec);
            } catch (ClassNotFoundException e) {
                throw new CompositionException("A required specification cannot be loaded : " + spec, e);
            }

            ServiceImporter importer = new ServiceImporter(specToImport, fil, agg, opt, null, DependencyModel.DYNAMIC_BINDING_POLICY, context, null, handler);

            handler.getRequirements().add(importer);
            SpecificationMetadata specMeta = new SpecificationMetadata(spec, m_context, agg, opt, this);
            m_services.add(specMeta); // Update the available types
            return;
View Full Code Here

            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);
        }
    }
View Full Code Here

            Object object = specField.get(null);
            if (object instanceof String) {
                Element specification = ManifestMetadataParser.parse((String) object);
                Element[] reqs = specification.getElements("requires");
                for (int j = 0; reqs != null && j < reqs.length; j++) {
                    ServiceImporter imp = getAttachedRequirement(reqs[j]);
                    if (imp != null) {
                        // Fix service-level dependency flag
                        imp.setServiceLevelDependency();
                    }
                    checkRequirement(imp, reqs[j]);
                }
            } else {
                error("[" + getCompositeManager().getInstanceName() + "] The specification field of the service specification " + svc.getSpecification() + " needs to be a String");
View Full Code Here

        String identity = element.getAttribute("id");
        if (identity != null) {
            // Look for dependency Id
            for (int i = 0; i < handler.getRequirements().size(); i++) {
                ServiceImporter imp = (ServiceImporter) handler.getRequirements().get(i);
                if (imp.getId().equals(identity)) { return imp; }
            }
        }

        // If not found or no id, look for a dependency with the same specification
        String requirement = element.getAttribute("specification");
        for (int i = 0; i < handler.getRequirements().size(); i++) {
            ServiceImporter imp = (ServiceImporter) handler.getRequirements().get(i);
            if (imp.getId().equals(requirement) || imp.getSpecification().getName().equals(requirement)) { return imp; }
        }
        return null;
    }
View Full Code Here

                specToImport = getCompositeManager().getGlobalContext().getBundle().loadClass(spec);
            } catch (ClassNotFoundException e) {
                throw new CompositionException("A required specification cannot be loaded : " + spec);
            }

            ServiceImporter importer = new ServiceImporter(specToImport, fil, agg, opt, null, DependencyModel.DYNAMIC_BINDING_POLICY, context, null, handler);

            handler.getRequirements().add(importer);
            SpecificationMetadata specMeta = new SpecificationMetadata(spec, m_context, agg, opt, this);
            m_services.add(specMeta); // Update the available types
            return;
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.composite.service.instantiator.ServiceImporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.