Package org.papoose.core.descriptions

Examples of org.papoose.core.descriptions.RequireDescription


        List<RequireDescription> requireDescriptions = checkPoint.getResolving().getRequireDescriptions();

        if (!requireDescriptions.isEmpty())
        {
            CheckPoint result = null;
            RequireDescription requireDescription = requireDescriptions.remove(0);

            for (CandidateBundle candidate : ResolverUtils.collectEligibleBundlesFromUsed(requireDescription, checkPoint))
            {
                if (candidate instanceof Resolved)
                {
                    try
                    {
                        Resolved resolvedHost = (Resolved) candidate;
                        result = doResolve(checkPoint.newCheckPointUsed(resolvedHost, requireDescription));
                    }
                    catch (IncompatibleException ie)
                    {
                        LOGGER.log(Level.FINEST, "Incompatible collection of host and required bundle", ie);
                    }
                }
                else if (candidate instanceof UnBound)
                {
                    assert false;
                }
                else
                {
                    try
                    {
                        BoundHost bound = (BoundHost) candidate;
                        result = doResolve(checkPoint.newCheckPoint(bound, requireDescription));
                    }
                    catch (IncompatibleException ie)
                    {
                        LOGGER.log(Level.FINEST, "Incompatible collection of host and required bundle", ie);
                    }
                }

                if (result != null) return result;
            }

            for (Candidate candidate : ResolverUtils.collectEligibleBundlesFromUnused(requireDescription, checkPoint))
            {
                if (candidate instanceof Resolved)
                {
                    try
                    {
                        Resolved resolvedHost = (Resolved) candidate;
                        result = doResolve(checkPoint.newCheckPointUnused(resolvedHost, requireDescription));
                    }
                    catch (IncompatibleException ie)
                    {
                        LOGGER.log(Level.FINEST, "Incompatible collection of host and required bundle", ie);
                    }
                }
                else if (candidate instanceof UnBound)
                {
                    UnBound unBound = (UnBound) candidate;
                    result = doResolve(checkPoint.newCheckPoint(unBound, requireDescription));
                }
                else
                {
                    assert false;
                }

                if (result != null) return result;
            }

            if (requireDescription.getResolution() == Resolution.MANDATORY) return null;
        }

        return resolveWires(checkPoint);
    }
View Full Code Here


        {
            String[] descriptions = Util.split(headers.getValue(Constants.REQUIRE_BUNDLE), ",");
            for (String description : descriptions)
            {
                Map<String, Object> parameters = new HashMap<String, Object>();
                RequireDescription requireDescription;
                int index = description.indexOf(';');

                if (index != -1)
                {
                    requireDescription = new RequireDescription(Util.checkSymbolName(description.substring(0, index)), parameters);

                    Util.parseParameters(description.substring(index + 1), requireDescription, parameters, true);
                }
                else
                {
                    requireDescription = new RequireDescription(Util.checkSymbolName(description), parameters);
                }

                if (requireDescription.getVisibility() == null) Util.callSetter(requireDescription, "visibility", Visibility.PRIVATE);

                if (requireDescription.getResolution() == null) Util.callSetter(requireDescription, "resolution", Resolution.MANDATORY);

                if (parameters.containsKey("bundle-version"))
                {
                    parameters.put("bundle-version", VersionRange.parseVersionRange((String) parameters.get("bundle-verison")));
                }
View Full Code Here

TOP

Related Classes of org.papoose.core.descriptions.RequireDescription

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.