Package org.papoose.core.descriptions

Examples of org.papoose.core.descriptions.FragmentDescription


                generation = ((UnResolved) candidate).getToBeResolved();

                if (generation instanceof FragmentGeneration)
                {
                    FragmentGeneration fragmentGeneration = (FragmentGeneration) generation;
                    FragmentDescription description = fragmentGeneration.getArchiveStore().getFragmentDescription();

                    if (fragmentGeneration.getState() == Bundle.INSTALLED
                        && description.getSymbolName().equals(hostSymbolName)
                        && description.getVersionRange().includes(hostVersion))
                    {
                        result.add(fragmentGeneration);
                    }
                }
            }
View Full Code Here


    private Generation allocateGeneration(BundleController bundle, ArchiveStore archiveStore) throws BundleException
    {
        if (archiveStore.getFragmentDescription() != null)
        {
            FragmentDescription description = archiveStore.getFragmentDescription();
            if (description.getExtension() == null)
            {
                return new FragmentGeneration(bundle, archiveStore);
            }
            else
            {
View Full Code Here

        return result;
    }

    private static FragmentDescription obtainBundleFragementHost(Attributes headers) throws BundleException
    {
        FragmentDescription fragmentDescription = null;

        if (headers.containsKey(Constants.FRAGMENT_HOST))
        {
            Map<String, Object> parameters = new HashMap<String, Object>();
            String description = headers.getValue(Constants.FRAGMENT_HOST);
            int index = description.indexOf(';');

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

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

            if (parameters.containsKey("bundle-version"))
            {
                try
                {
                    fragmentDescription.setVersionRange(VersionRange.parseVersionRange((String) parameters.get("bundle-verison")));
                }
                catch (IllegalArgumentException e)
                {
                    throw new BundleException("Illegal value for extension parameter", e);
                }
            }
            else
            {
                fragmentDescription.setVersionRange(FragmentDescription.DEFAULT_VERSION_RANGE);
            }

            if (parameters.containsKey("extension"))
            {
                try
                {
                    fragmentDescription.setExtension(Extension.valueOf((String) parameters.get("extension")));
                }
                catch (IllegalArgumentException e)
                {
                    throw new BundleException("Illegal value for extension parameter", e);
                }
View Full Code Here

TOP

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

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.