Package com.springsource.util.osgi.manifest

Examples of com.springsource.util.osgi.manifest.BundleManifest


    /**
     * {@inheritDoc}
     */
    public BundleManifest resolve(ManifestContents templateManifest, ReadablePartialManifest partial) {
        BundleManifest result = BundleManifestFactory.createBundleManifest(new SimpleParserLogger());

        processImports(result, templateManifest, partial);
        processExports(result, templateManifest, partial);

        return result;
View Full Code Here


        ManifestContents manifest = new SimpleManifestContents();
        mergeManifests(manifest, existingManifest);
        mergeManifests(manifest, manifestTemplate);
        mergeManifests(manifest, contributedManifest);

        BundleManifest resolved = this.partialManifestResolver.resolve(manifestTemplate, partialManifest);
        mergeManifests(manifest, toManifestContents(resolved));

        removeTemplateOnlyHeaders(manifest, templateOnlyHeaderNames);

        return manifest;
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Set<String> validate(ManifestContents manifest) {
        BundleManifest bundleManifest = BundleManifestUtils.createBundleManifest(manifest);
        if (bundleManifest.getBundleManifestVersion() != 2) {
            return Sets.asSet(String.format(MESSAGE, bundleManifest.getBundleManifestVersion()));
        }

        return Collections.emptySet();
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Set<String> validate(ManifestContents manifest) {
        BundleManifest bundleManifest = BundleManifestUtils.createBundleManifest(manifest);
        if (bundleManifest.getBundleSymbolicName() == null || bundleManifest.getBundleSymbolicName().getSymbolicName() == null) {
            return Sets.asSet(MESSAGE);
        }
        return Collections.emptySet();
    }
View Full Code Here

    private static final String MESSAGE = "The import of package %s has an unlikely version";

    public Set<String> validate(ManifestContents manifest) {
        Set<String> warnings = new HashSet<String>();

        BundleManifest bundleManifest = BundleManifestUtils.createBundleManifest(manifest);
        List<ImportedPackage> importedPackages = bundleManifest.getImportPackage().getImportedPackages();
        for (ImportedPackage importedPackage : importedPackages) {
            try {
                VersionRange versionRange = importedPackage.getVersion();

                if (isReversed(versionRange) || isExclusive(versionRange)) {
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Set<String> validate(ManifestContents manifest) {
        BundleManifest bundleManifest = BundleManifestUtils.createBundleManifest(manifest);
        Set<String> warnings = new HashSet<String>();

        for (ExportedPackage exportedPackage : bundleManifest.getExportPackage().getExportedPackages()) {
            String exportedName = exportedPackage.getPackageName();
            for (ImportedPackage importedPackage : bundleManifest.getImportPackage().getImportedPackages()) {
                if (importedPackage.getPackageName().equals(exportedName)) {
                    warnings.add(String.format(MESSAGE, exportedName));
                }
            }
        }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Set<String> validate(ManifestContents manifest) {
        BundleManifest bundleManifest = BundleManifestUtils.createBundleManifest(manifest);
        Set<String> warnings = new HashSet<String>();

        for (ExportedPackage packageExport : bundleManifest.getExportPackage().getExportedPackages()) {
            if (packageExport.getAttributes().get("version") == null) {
                warnings.add(String.format(MESSAGE, packageExport.getPackageName()));
            }
        }

View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Set<String> validate(ManifestContents manifest) {
        BundleManifest bundleManifest = BundleManifestUtils.createBundleManifest(manifest);
        Set<String> warnings = new HashSet<String>();

        for (ImportedPackage packageImport : bundleManifest.getImportPackage().getImportedPackages()) {
            if (packageImport.getAttributes().get("version") == null) {
                warnings.add(String.format(MESSAGE, packageImport.getPackageName()));
            }
        }

View Full Code Here

                if (isFragmentBundle(bundle) == false) {
                    bundle.start();
                }
      }
            if (!classpathBundle) {
                final BundleManifest manifest = BundleManifestFactory.createBundleManifest(bundle.getHeaders());
                saveBundleInRepository(tempFile, filename, manifest);
            } else {
                logger.warn("Temporarily updated classpath bundle: {}, update will be reverted after restart.", bundle.getSymbolicName());
            }
            return bundle;
View Full Code Here

    Set<SystemPackage> exportPackages = null;
    final Manifest manifest = jarFile.getManifest();
    if (manifest != null) {
      final Map<String, String> contents = convertAttributesToMap(manifest.getMainAttributes());
      try {
        final BundleManifest bundleManifest = new StandardBundleManifest(new DummyParserLogger(), contents);
        if (bundleManifest.getBundleName() != null) {
          final List<ExportedPackage> exportedPackages = bundleManifest.getExportPackage().getExportedPackages();
          exportPackages = new LinkedHashSet<SystemPackage>(exportedPackages.size());
          for (final ExportedPackage exportedPackage : exportedPackages) {
            final SystemPackage exportPackage = new SystemPackage(exportedPackage.getPackageName(),
                exportedPackage.getVersion().toString());
            exportPackages.add(exportPackage);
View Full Code Here

TOP

Related Classes of com.springsource.util.osgi.manifest.BundleManifest

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.