Package org.eclipse.osgi.service.resolver

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


  }

  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

      return null;

    Class<?> result = null;
    //size may change, so we must check it every time
    for (int i = 0; i < allDependents.size() && result == null; i++) {
      BundleDescription searchedBundle = allDependents.get(i);
      try {
        BundleLoaderProxy proxy = buddyRequester.getLoaderProxy(searchedBundle);
        if (proxy == null)
          continue;
        result = proxy.getBundleLoader().findClass(name);
View Full Code Here

      return null;

    URL result = null;
    //size may change, so we must check it every time
    for (int i = 0; i < allDependents.size() && result == null; i++) {
      BundleDescription searchedBundle = allDependents.get(i);
      BundleLoaderProxy proxy = buddyRequester.getLoaderProxy(searchedBundle);
      if (proxy == null)
        continue;
      result = proxy.getBundleLoader().findResource(name);
      if (result == null) {
View Full Code Here

      return null;

    Enumeration<URL> results = null;
    //size may change, so we must check it every time
    for (int i = 0; i < allDependents.size(); i++) {
      BundleDescription searchedBundle = allDependents.get(i);
      try {
        BundleLoaderProxy proxy = buddyRequester.getLoaderProxy(searchedBundle);
        if (proxy == null)
          continue;
        results = BundleLoader.compoundEnumerations(results, proxy.getBundleLoader().findResources(name));
View Full Code Here

  }

  private void basicAddImmediateDependents(BundleDescription root) {
    BundleDescription[] dependents = root.getDependents();
    for (int i = 0; i < dependents.length; i++) {
      BundleDescription toAdd = dependents[i];
      if (toAdd.getHost() == null && !allDependents.contains(toAdd)) {
        allDependents.add(toAdd);
      }
    }
  }
View Full Code Here

   * @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

    return adapt0(adapterType);
  }

  public List<BundleRevision> getRevisions() {
    List<BundleRevision> revisions = new ArrayList<BundleRevision>();
    BundleDescription current = getBundleDescription();
    if (current != null)
      revisions.add(current);
    BundleDescription[] removals = framework.adaptor.getState().getRemovalPending();
    for (BundleDescription removed : removals) {
      if (removed.getBundleId() == getBundleId() && removed != current) {
View Full Code Here

      }
    }
    if (BundleWiring.class.equals(adapterType)) {
      if (state == UNINSTALLED)
        return null;
      BundleDescription description = getBundleDescription();
      return (A) description.getWiring();
    }

    if (BundleRevision.class.equals(adapterType)) {
      if (state == UNINSTALLED)
        return null;
View Full Code Here

    State state = platformAdmin.getState(false /*mutable*/);
    if (state == null) {
      System.err.println("Resolver state is null");
      return errors;
    }
    BundleDescription description = state.getBundle(bundle.getBundleId());
    if (description == null) {
      System.err.println("Could not determine BundleDescription for " + bundle.toString());
    }
    getRelevantErrors(state, errors, description);
    return errors;
View Full Code Here

TOP

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

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.