Package org.eclipse.osgi.framework.util

Examples of org.eclipse.osgi.framework.util.KeyedHashSet$EquinoxSetIterator


  private HashMap bundlesBySymbolicName;

  public BundleRepository(int initialCapacity) {
    synchronized (this) {
      bundlesByInstallOrder = new ArrayList(initialCapacity);
      bundlesById = new KeyedHashSet(initialCapacity, true);
      bundlesBySymbolicName = new HashMap(initialCapacity);
    }
  }
View Full Code Here


    }
  }

  public synchronized void removeAllBundles() {
    bundlesByInstallOrder.clear();
    bundlesById = new KeyedHashSet();
    bundlesBySymbolicName.clear();
  }
View Full Code Here

    // Note that dynamic imports are not checked to avoid aggressive wiring (bug 105779) 
    return findRequiredSource(pkgName, null);
  }

  private PackageSource findImportedSource(String pkgName, KeyedHashSet visited) {
    KeyedHashSet imports = getImportedSources(visited);
    if (imports == null)
      return null;
    synchronized (imports) {
      return (PackageSource) imports.getByKey(pkgName);
    }
  }
View Full Code Here

      ExportPackageDescription exportPackage = bundle.getFramework().getAdaptor().getState().linkDynamicImport(proxy.getBundleDescription(), pkgName);
      if (exportPackage != null) {
        PackageSource source = createExportPackageSource(exportPackage, null);
        synchronized (this) {
          if (importedSources == null)
            importedSources = new KeyedHashSet(false);
        }
        synchronized (importedSources) {
          importedSources.add(source);
        }
        return source;
View Full Code Here

      PackageSource result = (PackageSource) requiredSources.getByKey(pkgName);
      if (result != null)
        return result.isNullSource() ? null : result;
    }
    if (visited == null)
      visited = new KeyedHashSet(false);
    visited.add(bundle); // always add ourselves so we do not recurse back to ourselves
    List<PackageSource> result = new ArrayList<PackageSource>(3);
    for (int i = 0; i < requiredBundles.length; i++) {
      BundleLoader requiredLoader = requiredBundles[i].getBundleLoader();
      requiredLoader.addExportedProvidersFor(proxy.getSymbolicName(), pkgName, result, visited);
View Full Code Here

  final private KeyedHashSet pkgSources;

  public BundleLoaderProxy(BundleHost bundle, BundleDescription description) {
    this.bundle = bundle;
    this.description = description;
    this.pkgSources = new KeyedHashSet(false);
    this.data = bundle.getBundleData();
  }
View Full Code Here

    return null;
  }

  public static synchronized NullPackageSource getNullPackageSource(String name) {
    if (sources == null)
      sources = new KeyedHashSet();
    NullPackageSource result = (NullPackageSource) sources.getByKey(name);
    if (result != null)
      return result;
    result = new NullPackageSource(name);
    sources.add(result);
View Full Code Here

        reexportTable = new int[reexportIndex];
        System.arraycopy(reexported, 0, reexportTable, 0, reexportIndex);
      } else {
        reexportTable = null;
      }
      requiredSources = new KeyedHashSet(10, false);
    } else {
      requiredBundles = null;
      reexportTable = null;
      requiredSources = null;
    }
View Full Code Here

      return importedSources;
    BundleDescription bundleDesc = proxy.getBundleDescription();
    ExportPackageDescription[] packages = bundleDesc.getResolvedImports();
    if (packages != null && packages.length > 0) {
      if (importedSources == null)
        importedSources = new KeyedHashSet(packages.length, false);
      for (int i = 0; i < packages.length; i++) {
        if (packages[i].getExporter() == bundleDesc)
          continue; // ignore imports resolved to this bundle
        PackageSource source = createExportPackageSource(packages[i], visited);
        if (source != null)
View Full Code Here

    if ((path.length() > 1) && (path.charAt(0) == '/')) /* if name has a leading slash */
      path = path.substring(1); /* remove leading slash before search */
    boolean subPackages = (options & BundleWiring.LISTRESOURCES_RECURSE) != 0;
    List<String> packages = new ArrayList<String>();
    // search imported package names
    KeyedHashSet importSources = getImportedSources(null);
    if (importSources != null) {
      KeyedElement[] imports = importSources.elements();
      for (KeyedElement keyedElement : imports) {
        String id = ((PackageSource) keyedElement).getId();
        if (id.equals(pkgName) || (subPackages && isSubPackage(pkgName, id)))
          packages.add(id);
      }
    }

    // now add package names from required bundles
    if (requiredBundles != null) {
      KeyedHashSet visited = new KeyedHashSet(false);
      visited.add(bundle); // always add ourselves so we do not recurse back to ourselves
      for (BundleLoaderProxy requiredProxy : requiredBundles) {
        BundleLoader requiredLoader = requiredProxy.getBundleLoader();
        requiredLoader.addProvidedPackageNames(requiredProxy.getSymbolicName(), pkgName, packages, subPackages, visited);
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.framework.util.KeyedHashSet$EquinoxSetIterator

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.