Package org.osgi.framework

Examples of org.osgi.framework.Version.compareTo()


        if ((bundle.getState() & Bundle.UNINSTALLED) != 0) {
            return false;
        }
        if (isTuscanyService) {
            Version scaVersion = getSCAVersion(bundle);
            return scaVersion.compareTo(version) == 0;
        }
        return true;
    }

    protected Collection<Bundle> getBundles(boolean isTuscanyService) {
View Full Code Here


                .getProperty(Constants.FRAMEWORK_VERSION);
            return (version == null) ? Version.emptyVersion
                : new Version(version);
          }
        });
    final boolean endMatchSupported = (frameworkVersion
        .compareTo(endMatchVersion) >= 0);
    this.listenerFilter = endMatchSupported ? filter.toString() : null;
    this.filter = filter;
    this.customizer = (customizer == null) ? this : customizer;
    if ((context == null) || (filter == null)) {
View Full Code Here

                    // look for JavaSE if 1.6 or greater; otherwise look for J2SE
                    Version v16 = new Version("1.6"); //$NON-NLS-1$
                    javaEdition = J2SE;
                    try {
                        javaVersion = new Version(javaSpecVersion);
                        if (v16.compareTo(javaVersion) <= 0)
                            javaEdition = JAVASE;
                    } catch (IllegalArgumentException e) {
                        // do nothing
                    }
                    vmProfile = javaEdition + javaSpecVersion;
View Full Code Here

            if (feature == null) {
                if (FeatureImpl.DEFAULT_VERSION.equals(version)) {
                    Version latest = new Version(cleanupVersion(version));
                    for (String available : versions.keySet()) {
                        Version availableVersion = new Version(cleanupVersion(available));
                        if (availableVersion.compareTo(latest) > 0) {
                            feature = versions.get(available);
                            latest = availableVersion;
                        }
                    }
                } else {
View Full Code Here

                } else {
                    Version latest = new Version(cleanupVersion(FeatureImpl.DEFAULT_VERSION));
                    VersionRange versionRange = new VersionRange(version, true, true);
                    for (String available : versions.keySet()) {
                        Version availableVersion = new Version(cleanupVersion(available));
                        if (availableVersion.compareTo(latest) > 0 && versionRange.contains(availableVersion)) {
                            feature = versions.get(available);
                            latest = availableVersion;
                        }
                    }
                }
View Full Code Here

                bundle.readManifest();
                BundleRef existingBundle = bundleVersions.get(bundle.getBundleSymbolicName());
                if (existingBundle != null) {
                    Version existingVersion = new Version(existingBundle.getBundleVersion());
                    Version newVersion = new Version(bundle.getBundleVersion());
                    if (newVersion.compareTo(existingVersion) > 0) {
                        bundleVersions.put(bundle.getBundleSymbolicName(), bundle);
                    }
                } else {
                    bundleVersions.put(bundle.getBundleSymbolicName(), bundle);
                }
View Full Code Here

            URL url = new URL(host, "deployment/" + gatewayID + "/versions/");
            Version highestRemoteVersion = getHighestRemoteVersion(url);

            m_log.log(LogService.LOG_INFO, "Highest remote: " + highestRemoteVersion + " / Highest local: " + highestLocalVersion);
            if ((highestRemoteVersion != null) && ((highestLocalVersion == null) || (highestRemoteVersion.compareTo(highestLocalVersion) > 0))) {
                // no local version or local version lower than remote, install the update
                installVersion(url, highestRemoteVersion, highestLocalVersion);
            }
        }
        catch (MalformedURLException e) {
View Full Code Here

        for (Iterator i = versions.iterator(); i.hasNext(); ) {
            Version version = (Version) i.next();
            if (highestVersion == null) {
                highestVersion = version;
            }
            else if (version.compareTo(highestVersion) > 0) {
                highestVersion = version;
            }
        }
        return highestVersion;
    }
View Full Code Here

            }

            URL url = new URL(host, "deployment/" + gatewayID + "/versions/");
            Version highestRemoteVersion = getHighestRemoteVersion(url);
            m_log.log(LogService.LOG_INFO, "Highest remote: " + highestRemoteVersion + " / Highest local: " + highestLocalVersion);
            if ((highestRemoteVersion != null) && ((highestLocalVersion == null) || (highestRemoteVersion.compareTo(highestLocalVersion) > 0))) {
                Properties properties = new Properties();
                properties.put("deploymentpackage.localversion", ((highestLocalVersion == null) ? Version.emptyVersion : highestLocalVersion));
                properties.put("deploymentpackage.remoteversion", highestRemoteVersion);
                m_eventAdmin.postEvent(new Event(TOPIC_UPDATE_AVAILABLE, (Dictionary) properties));
            }
View Full Code Here

            if (i == 0) {
                idx = 0;
                v = resources[i].getVersion();
            } else {
                Version vtmp = resources[i].getVersion();
                if (vtmp.compareTo(v) > 0) {
                    idx = i;
                    v = vtmp;
                }
            }
        }
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.