Examples of BundleRequirement


Examples of org.apache.ivy.osgi.core.BundleRequirement

        VersionRange range = getVersionRange();
        String resolution = optional ? "optional" : null;
        if (type == null) {
            throw new ParseException("No requirement actually specified", 0);
        }
        BundleRequirement requirement = new BundleRequirement(type, name, range, resolution);
        info.addRequirement(requirement);
        if (BundleInfo.EXECUTION_ENVIRONMENT_TYPE.equals(type)) {
            info.addExecutionEnvironment(name);
        }
    }
View Full Code Here

Examples of org.apache.ivy.osgi.core.BundleRequirement

                            Message.debug("Unsupported required capability " + child.namespace
                                    + " " + name + " " + range);
                        }
                    } else {
                        String resolution = child.optional ? "optional" : null;
                        requirements.add(new BundleRequirement(type, name, range, resolution));
                    }
                }
            });
        }
View Full Code Here

Examples of org.apache.ivy.osgi.core.BundleRequirement

        b.setDescription(feature.getDescription());
        b.setLicense(feature.getLicense());

        for (EclipsePlugin plugin : feature.getPlugins()) {
            BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, plugin.getId(),
                    new VersionRange(plugin.getVersion()), null);
            b.addRequirement(r);
        }

        for (Require require : feature.getRequires()) {
            String id;
            if (require.getPlugin() != null) {
                id = require.getPlugin();
            } else {
                id = require.getFeature();
            }
            VersionRange range;
            if (require.getMatch().equals("greaterOrEqual")) {
                range = new VersionRange(require.getVersion());
            } else {
                throw new IllegalStateException("unsupported match " + require.getMatch());
            }
            BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, id, range, null);
            b.addRequirement(r);
        }

        return b;
    }
View Full Code Here

Examples of org.apache.ivy.osgi.core.BundleRequirement

            addChild(new RequiredHandler(), new ChildElementHandler() {
                public void childHanlded(DelegetingHandler child) {
                    String name = ((RequiredHandler) child).name;
                    VersionRange range = ((RequiredHandler) child).range;
                    String type = namespace2Type(((RequiredHandler) child).namespace);
                    requirements.add(new BundleRequirement(type, name, range, null));
                }
            });
        }
View Full Code Here

Examples of org.apache.ivy.osgi.core.BundleRequirement

            BundleCapability capability = (BundleCapability) itCapabilities.next();
            saxCapability(capability, handler);
        }
        Iterator itRequirement = bundleInfo.getRequirements().iterator();
        while (itRequirement.hasNext()) {
            BundleRequirement requirement = (BundleRequirement) itRequirement.next();
            saxRequirement(requirement, handler);
        }
        handler.endElement("", ResourceHandler.RESOURCE, ResourceHandler.RESOURCE);
        handler.characters("\n".toCharArray(), 0, 1);
    }
View Full Code Here

Examples of org.apache.ivy.osgi.core.BundleRequirement

        VersionRange range = getVersionRange();
        String resolution = optional ? "optional" : null;
        if (type == null) {
            throw new ParseException("No requirement actually specified", 0);
        }
        BundleRequirement requirement = new BundleRequirement(type, name, range, resolution);
        info.addRequirement(requirement);
    }
View Full Code Here

Examples of org.apache.ivy.osgi.core.BundleRequirement

        b.setLicense(feature.getLicense());

        Iterator itPlugins = feature.getPlugins().iterator();
        while (itPlugins.hasNext()) {
            EclipsePlugin plugin = (EclipsePlugin) itPlugins.next();
            BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, plugin.getId(),
                    new VersionRange(plugin.getVersion()), null);
            b.addRequirement(r);
        }

        Iterator itRequires = feature.getRequires().iterator();
        while (itRequires.hasNext()) {
            Require require = (Require) itRequires.next();
            String id;
            if (require.getPlugin() != null) {
                id = require.getPlugin();
            } else {
                id = require.getFeature();
            }
            VersionRange range;
            if (require.getMatch().equals("greaterOrEqual")) {
                range = new VersionRange(require.getVersion());
            } else {
                throw new IllegalStateException("unsupported match " + require.getMatch());
            }
            BundleRequirement r = new BundleRequirement(BundleInfo.BUNDLE_TYPE, id, range, null);
            b.addRequirement(r);
        }

        return b;
    }
View Full Code Here

Examples of org.apache.ivy.osgi.core.BundleRequirement

                    String type = namespace2Type(((RequiredHandler) child).namespace);
                    if (type == null) {
                        Message.debug("Unsupported required capability "
                                + ((RequiredHandler) child).namespace + " " + name + " " + range);
                    } else {
                        requirements.add(new BundleRequirement(type, name, range, null));
                    }
                }
            });
        }
View Full Code Here

Examples of org.osgi.framework.wiring.BundleRequirement

        }

        // If we have requirements remaining, then find candidates for them.
        while (!remainingReqs.isEmpty())
        {
            BundleRequirement req = remainingReqs.remove(0);

            // Ignore non-effective and dynamic requirements.
            String resolution = req.getDirectives().get(Constants.RESOLUTION_DIRECTIVE);
            if (!rc.isEffective(req)
                || ((resolution != null)
                    && resolution.equals(FelixConstants.RESOLUTION_DYNAMIC)))
            {
                continue;
View Full Code Here

Examples of org.osgi.framework.wiring.BundleRequirement

    {
        // Create a modifiable list of the revision's requirements.
        List<BundleRequirement> remainingReqs =
            new ArrayList(revision.getDeclaredRequirements(null));
        // Find the host requirement.
        BundleRequirement hostReq = null;
        for (Iterator<BundleRequirement> it = remainingReqs.iterator();
            it.hasNext(); )
        {
            BundleRequirement r = it.next();
            if (r.getNamespace().equals(BundleRevision.HOST_NAMESPACE))
            {
                hostReq = r;
                it.remove();
                break;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.