Package org.eclipse.osgi.service.resolver

Examples of org.eclipse.osgi.service.resolver.ExportPackageDescription


    }
    // process all imports
    // must check resolved imports to get any dynamically resolved imports
    ExportPackageDescription[] imports = bundle.getBundle().getResolvedImports();
    for (int i = 0; i < imports.length; i++) {
      ExportPackageDescription importPkg = imports[i];
      Object[] exports = bundle.getResolver().getResolverExports().get(importPkg.getName());
      for (int j = 0; j < exports.length; j++) {
        ResolverExport export = (ResolverExport) exports[j];
        if (export.getExportPackageDescription() == importPkg)
          isConsistentInternal(bundle, export, true, null);
      }
View Full Code Here


    // check imports
    if (bundle.getBundle().isResolved()) {
      // must check resolved imports to get any dynamically resolved imports
      ExportPackageDescription[] imports = bundle.getBundle().getResolvedImports();
      for (int i = 0; i < imports.length; i++) {
        ExportPackageDescription importPkg = imports[i];
        if (importPkg.getExporter() == bundle.getBundle() || !importPkg.getName().equals(packageName))
          continue;
        Object[] exports = bundle.getResolver().getResolverExports().get(packageName);
        for (int j = 0; j < exports.length; j++) {
          ResolverExport export = (ResolverExport) exports[j];
          if (export.getExportPackageDescription() == importPkg)
View Full Code Here

                if (includeOptional || !required[i].isOptional())
                    addBundleAndDependencies((BundleDescription)required[i].getSupplier(), bundleIds, includeOptional);
            }
            ImportPackageSpecification[] importedPkgs = desc.getImportPackages();
            for (int i = 0; i < importedPkgs.length; i++) {
                ExportPackageDescription exporter = (ExportPackageDescription)importedPkgs[i].getSupplier();
                // Continue if the Imported Package is unresolved of the package is optional and don't want optional packages
                if (exporter == null || (!includeOptional && Constants.RESOLUTION_OPTIONAL.equals(importedPkgs[i]
                    .getDirective(Constants.RESOLUTION_DIRECTIVE))))
                    continue;
                addBundleAndDependencies(exporter.getExporter(), bundleIds, includeOptional);
            }
            BundleDescription[] fragments = desc.getFragments();
            for (int i = 0; i < fragments.length; i++) {
                if (!fragments[i].isResolved())
                    continue;
View Full Code Here

    private PackageEdge processImportPackage(PackageGraph graph, BundleDescription importer, ImportPackageSpecification importPackage) {
        return processImportPackage(graph, importer, importPackage, importPackage);
    }
       
    private PackageEdge processImportPackage(PackageGraph graph, BundleDescription importer, ImportPackageSpecification importPackage, ImportPackageSpecification startImportPackage) {
        ExportPackageDescription exportedPackage = null;
        if (importer.isResolved()) {
            exportedPackage = findExportPackage(importPackage.getName(), importer.getResolvedImports());
        } else {
            exportedPackage = findExportPackage(importPackage, state.getExportedPackages());
            if (exportedPackage == null) {
View Full Code Here

            BundleDescription bundle = exportedPackage.getExporter();
            for (String usePackageName : uses) {
                // see uses clause points to import or export package
                ImportPackageSpecification useImportPackage = findImportPackage(usePackageName, bundle.getImportPackages());
                if (useImportPackage == null) {
                    ExportPackageDescription useExportPackage = findExportPackage(usePackageName, bundle.getExportPackages());
                    if (useExportPackage == null) {
                        throw new RuntimeException("No import or export package for an 'uses' package " + usePackageName + " in " + Utils.bundleToString(bundle));
                    } else {
                        PackageEdge edge = new PackageEdge(processExportPackage(graph, useExportPackage, startImportPackage));
                        node.addEdge(edge);
View Full Code Here

                if (includeOptional || !required[i].isOptional())
                    addBundleAndDependencies((BundleDescription)required[i].getSupplier(), bundleIds, includeOptional);
            }
            ImportPackageSpecification[] importedPkgs = desc.getImportPackages();
            for (int i = 0; i < importedPkgs.length; i++) {
                ExportPackageDescription exporter = (ExportPackageDescription)importedPkgs[i].getSupplier();
                // Continue if the Imported Package is unresolved of the package is optional and don't want optional packages
                if (exporter == null || (!includeOptional && Constants.RESOLUTION_OPTIONAL.equals(importedPkgs[i]
                    .getDirective(Constants.RESOLUTION_DIRECTIVE))))
                    continue;
                addBundleAndDependencies(exporter.getExporter(), bundleIds, includeOptional);
            }
            BundleDescription[] fragments = desc.getFragments();
            for (int i = 0; i < fragments.length; i++) {
                if (!fragments[i].isResolved())
                    continue;
View Full Code Here

    private PackageEdge processImportPackage(PackageGraph graph, BundleDescription importer, ImportPackageSpecification importPackage) {
        return processImportPackage(graph, importer, importPackage, importPackage);
    }
       
    private PackageEdge processImportPackage(PackageGraph graph, BundleDescription importer, ImportPackageSpecification importPackage, ImportPackageSpecification startImportPackage) {
        ExportPackageDescription exportedPackage = null;
        if (importer.isResolved()) {
            exportedPackage = findExportPackage(importPackage.getName(), importer.getResolvedImports());
        } else {
            exportedPackage = findExportPackage(importPackage, state.getExportedPackages());
            if (exportedPackage == null) {
View Full Code Here

            BundleDescription bundle = exportedPackage.getExporter();
            for (String usePackageName : uses) {
                // see uses clause points to import or export package
                ImportPackageSpecification useImportPackage = findImportPackage(usePackageName, bundle.getImportPackages());
                if (useImportPackage == null) {
                    ExportPackageDescription useExportPackage = findExportPackage(usePackageName, bundle.getExportPackages());
                    if (useExportPackage == null) {
                        // Ignore bad package in "uses" directive
                        // throw new RuntimeException("No import or export package for an 'uses' package " + usePackageName + " in " + Utils.bundleToString(bundle));
                    } else {
                        PackageEdge edge = new PackageEdge(processExportPackage(graph, useExportPackage, startImportPackage));
View Full Code Here

       
        int size = packageExportList.size();
        if (size == 0) {
            errorDetail.add("Package " + packageName + " is not exported by any bundle.");
        } else if (size == 1) {
            ExportPackageDescription packageExport = packageExportList.get(0);
            BundleDescription exporter = packageExport.getExporter();
            errorDetail.add("Bundle " + bundleToString(exporter) + " exports " + exportToString(packageExport) + " package which does not satisfy the dependency.");
        } else {
            for (ExportPackageDescription packageExport : packageExportList) {
                BundleDescription exporter = packageExport.getExporter();
                if (exporter.isResolved() &&
                    !isSelectedExportPackage(packageExport) &&
                    importPackage.isSatisfiedBy(packageExport)) {
                    // export is not selected but it does satisfy the import
                    errorDetail.add("Bundle " + bundleToString(exporter) + " exports " + exportToString(packageExport) + " package which satisfies the dependency but is unselected.");
View Full Code Here

                if (includeOptional || !required[i].isOptional())
                    addBundleAndDependencies((BundleDescription)required[i].getSupplier(), bundleIds, includeOptional);
            }
            ImportPackageSpecification[] importedPkgs = desc.getImportPackages();
            for (int i = 0; i < importedPkgs.length; i++) {
                ExportPackageDescription exporter = (ExportPackageDescription)importedPkgs[i].getSupplier();
                // Continue if the Imported Package is unresolved of the package is optional and don't want optional packages
                if (exporter == null || (!includeOptional && Constants.RESOLUTION_OPTIONAL.equals(importedPkgs[i]
                    .getDirective(Constants.RESOLUTION_DIRECTIVE))))
                    continue;
                addBundleAndDependencies(exporter.getExporter(), bundleIds, includeOptional);
            }
            BundleDescription[] fragments = desc.getFragments();
            for (int i = 0; i < fragments.length; i++) {
                if (!fragments[i].isResolved())
                    continue;
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.service.resolver.ExportPackageDescription

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.