Package org.osgi.framework

Examples of org.osgi.framework.Version


        LDAPExpr expr;
        VersionRange range;

        expr = LDAPParser.parseExpression("(version>=1.0.0)");
        range = VersionRangeHelper.decodeVersions(expr);
        assertEquals(new VersionRange(false, new Version(1, 0, 0),
            VersionRange.INFINITE_VERSION, true), range);
    }
View Full Code Here


        LDAPExpr expr;
        VersionRange range;

        expr = LDAPParser.parseExpression("(version>1.0.0)");
        range = VersionRangeHelper.decodeVersions(expr);
        assertEquals(new VersionRange(true, new Version(1, 0, 0),
            VersionRange.INFINITE_VERSION, true), range);
    }
View Full Code Here

        LDAPExpr expr;
        VersionRange range;

        expr = LDAPParser.parseExpression("(!(version<=1.0.0))");
        range = VersionRangeHelper.decodeVersions(expr);
        assertEquals(new VersionRange(true, new Version(1, 0, 0),
            VersionRange.INFINITE_VERSION, true), range);
    }
View Full Code Here

        return str == null ? null : (str.trim().length() == 0 ? null : str.trim());
    }

    private static Version nullIfInvalidVersion(String text)
    {
        Version version = null;
        try
        {
            String v = nullIfEmpty(text);
            if (v != null)
            {
View Full Code Here

        currentProject = firstPage.getProjectHandle();
        currentProjectLocation = getProjectLocationURI();

        String bsn = firstPage.getBundleSymbolicName();
        String description = firstPage.getDescription();
        Version projectVersion = firstPage.getVersion();
        String vendor = firstPage.getVendor();
        String name = firstPage.getName();

        createProject(currentProject, currentProjectLocation, monitor);
View Full Code Here

        // Verify whether all source bundles are available in the target package or absent...
        BundleInfoImpl[] bundleInfos = source.getBundleInfoImpls();
        for (int i = 0; i < bundleInfos.length; i++) {
            String symbolicName = bundleInfos[i].getSymbolicName();
            Version version = bundleInfos[i].getVersion();

            DeploymentPackage targetPackage = getDeploymentPackageContainingBundleWithSymbolicName(symbolicName);
            // If found, it should match the given target DP; not found is also ok...
            if ((targetPackage != null) && !targetPackage.equals(target)) {
                m_log.log(LogService.LOG_ERROR, "Bundle '" + symbolicName + "/" + version + " already present in other deployment packages!");
                throw new DeploymentException(CODE_BUNDLE_SHARING_VIOLATION, "Bundle '" + symbolicName + "/" + version + " already present in other deployment packages!");
            }

            if (targetPackage == null) {
                // Maybe the bundle is installed without deployment admin...
                for (int j = 0; j < foreignBundles.length; j++) {
                    if (symbolicName.equals(foreignBundles[j].getSymbolicName()) && version.equals(foreignBundles[j].getVersion())) {
                        m_log.log(LogService.LOG_ERROR, "Bundle '" + symbolicName + "/" + version + " already present!");
                        throw new DeploymentException(CODE_BUNDLE_SHARING_VIOLATION, "Bundle '" + symbolicName + "/" + version + " already present!");
                    }
                }
            }
View Full Code Here

        // TODO: verify symbolic name and entry-names for valid format/chars
        m_symbolicName = getNonNullHeader(mainAttributes.getValue(DEPLOYMENTPACKAGE_SYMBOLICMAME));

        String version = getNonNullHeader(mainAttributes.getValue(DEPLOYMENTPACKAGE_VERSION));
        try {
            m_version = new Version(version);
        }
        catch (IllegalArgumentException e) {
            throw new DeploymentException(CODE_BAD_HEADER);
        }
View Full Code Here

    @Override
    protected void elementSelected(E selection)
    {
        if (selection != null)
        {
            Version version = selection.getVersion();
            selectedVersions = ModelHelper.getDefaultRange(version);
            pnlVersionRange.setVersions(selectedVersions);
        }
    }
View Full Code Here

                {
                    versions = null;
                }
                else
                {
                    Version v = VersionTable.getVersion(specificText.getText().trim());
                    versions = new VersionRange(false, v, v, false);
                }
            }
            else
            {
                Version min = VersionTable.getVersion(minimumText.getText());
                Version max = "*".equals(maximumText.getText()) ? VersionRange.INFINITE_VERSION
                    : VersionTable.getVersion(maximumText.getText());
                versions = new VersionRange(!minInclusiveButton.getSelection(), min, max,
                    !maxInclusiveButton.getSelection());
            }
            fireValidationMessage(null, IMessageProvider.NONE);
View Full Code Here

            ? Constants.FRAMEWORK_BSNVERSION_MANAGED
            : allowMultiple;
        if (revision.getManifestVersion().equals("2")
            && !allowMultiple.equals(Constants.FRAMEWORK_BSNVERSION_MULTIPLE))
        {
            Version bundleVersion = revision.getVersion();
            bundleVersion = (bundleVersion == null) ? Version.emptyVersion : bundleVersion;
            String symName = revision.getSymbolicName();

            List<Bundle> collisionCanditates = new ArrayList<Bundle>();
            Bundle[] bundles = getFramework().getBundles();
            for (int i = 0; (bundles != null) && (i < bundles.length); i++)
            {
                long id = ((BundleImpl) bundles[i]).getBundleId();
                if (id != getBundleId())
                {
                    if (symName.equals(bundles[i].getSymbolicName())
                        && bundleVersion.equals(bundles[i].getVersion()))
                    {
                        collisionCanditates.add(bundles[i]);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.osgi.framework.Version

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.