Examples of BundleDescription


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

   * @return BundleContext for this bundle.
   */
  abstract protected BundleContextImpl getContext();

  public BundleException getResolutionFailureException() {
    BundleDescription bundleDescription = getBundleDescription();
    if (bundleDescription == null)
      return new BundleException(NLS.bind(Msg.BUNDLE_UNRESOLVED_EXCEPTION, this.toString()), BundleException.RESOLVE_ERROR);
    // just a sanity check - this would be an inconsistency between the framework and the state
    if (bundleDescription.isResolved())
      return new BundleException(Msg.BUNDLE_UNRESOLVED_STATE_CONFLICT, BundleException.RESOLVE_ERROR);
    return getResolverError(bundleDescription);
  }
View Full Code Here

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

            stateController.addBundle(target);
        } catch (BundleException e) {
            log.error(e.getMessage(), e);
        }       
        stateController.resolveState();
        BundleDescription b = stateController.getBundleDescription(target);               
        if (b != null) {
            displayManifest(b);
        }   
    }
View Full Code Here

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

    }

    private BundleDescription addBundle(Dictionary enhancedManifest, File bundleLocation, boolean override)
        throws BundleException {

        BundleDescription descriptor =
            factory.createBundleDescription(state, enhancedManifest, bundleLocation.getAbsolutePath(), getNextId());

        setUserProperty(descriptor, PROP_MANIFEST, enhancedManifest);
        if (override) {
            BundleDescription[] conflicts = state.getBundles(descriptor.getSymbolicName());
            if (conflicts != null) {
                for (BundleDescription conflict : conflicts) {
                    state.removeBundle(conflict);
                    logger
                        .warn(conflict.toString() + " has been replaced by another bundle with the same symbolic name "
                            + descriptor.toString());
                }
            }
        }

        state.addBundle(descriptor);
View Full Code Here

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

    public Set<ResolverError> getAllErrors() {
        BundleDescription[] bundles = state.getBundles();
        Set<ResolverError> errors = new LinkedHashSet<ResolverError>();
        for (int i = 0; i < bundles.length; i++) {
            BundleDescription bundle = bundles[i];
            ResolverError[] bundleErrors = state.getResolverErrors(bundle);
            if (bundleErrors != null) {
                errors.addAll(Arrays.asList(bundleErrors));
            }
        }
View Full Code Here

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

        Set<Long> bundleIds = new LinkedHashSet<Long>();
        addBundleAndDependencies(desc, bundleIds, true);
        List<BundleDescription> dependencies = new ArrayList<BundleDescription>();
        for (long bundleId : bundleIds) {
            if (desc.getBundleId() != bundleId) {
                BundleDescription dependency = state.getBundle(bundleId);
                BundleDescription supplier = dependency.getSupplier().getSupplier();
                HostSpecification host = supplier.getHost();
                if (host == null || !desc.equals(host.getSupplier())) {
                    dependencies.add(dependency);
                }
            }
        }
View Full Code Here

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

       
    }
   
    private boolean hasMultipleDifferentExporters(Set<PackageNode> versions) {
        if (versions.size() > 1) {
            BundleDescription exporter = null;
            for (PackageNode version : versions) {
                if (exporter == null) {
                    exporter = version.getExportPackage().getExporter();
                } else if (exporter != version.getExportPackage().getExporter()) {
                    return true;
View Full Code Here

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

        }
        node = graph.addNode(exportedPackage, startImportPackage);
       
        String[] uses = (String[]) exportedPackage.getDirective("uses");
        if (uses != null) {
            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

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

        try {
            State systemState = platformAdmin.getState(false);
            Iterator<Long> iterator = ids.iterator();
            while (iterator.hasNext()) {
                Long id = iterator.next();
                BundleDescription bundle = systemState.getBundle(id);
                if (bundle == null) {
                    System.err.println("Bundle ID" + id + " is invalid");
                    continue;
                }
                diagnose(bundle, platformAdmin);
View Full Code Here

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

        try {
            PlatformAdmin platformAdmin = (PlatformAdmin) bundleContext.getService(ref);
            State systemState = platformAdmin.getState(false);
            List<BundleDescription> bundleDescriptions = new ArrayList<BundleDescription>(bundles.size());
            for (Bundle bundle : bundles) {
                BundleDescription bundleDescription = systemState.getBundle(bundle.getBundleId());
                if (bundleDescription != null) {
                    bundleDescriptions.add(bundleDescription);
                }
            }
            for (BundleDescription bundleDescription : bundleDescriptions) {
View Full Code Here

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

  }

  private boolean validExports(ExportPackageDescription[] matchingExports) {
    // make sure each matching exports matches the export signature of the composite
    CompositeModule composite = (CompositeModule) getCompanionBundle();
    BundleDescription childDesc = composite.getCompositeDescription();
    ExportPackageDescription[] childExports = childDesc.getExportPackages();
    for (int i = 0; i < matchingExports.length; i++) {
      for (int j = 0; j < childExports.length; j++) {
        if (matchingExports[i].getName().equals(childExports[j].getName())) {
          if (!validateExport(matchingExports[i], childExports[j]))
            return false;
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.