private void initializeExports(ExportPackageDescription[] exports, Collection<String> exportNames) { for (int i = 0; i < exports.length; i++) { if (proxy.forceSourceCreation(exports[i])) { if (!exportNames.contains(exports[i].getName())) { // must force filtered and reexport sources to be created early // to prevent lazy normal package source creation. // We only do this for the first export of a package name. proxy.createPackageSource(exports[i], true); } } exportNames.add(exports[i].getName()); } }
private void initializeExports(ExportPackageDescription[] exports, Collection<String> exportNames) { for (int i = 0; i < exports.length; i++) { if (proxy.forceSourceCreation(exports[i])) { if (!exportNames.contains(exports[i].getName())) { // must force filtered and reexport sources to be created early // to prevent lazy normal package source creation. // We only do this for the first export of a package name. proxy.createPackageSource(exports[i], true); } } exportNames.add(exports[i].getName()); } }
public Bundle[] getImportingBundles() { if (supplier.isStale()) return null; AbstractBundle bundle = (AbstractBundle) getExportingBundle(); if (bundle == null) return null; AbstractBundle[] bundles = bundle.framework.getAllBundles(); List<Bundle> importers = new ArrayList<Bundle>(10); PackageSource supplierSource = supplier.createPackageSource(exportedPackage, false); for (int i = 0; i < bundles.length; i++) { if (!(bundles[i] instanceof BundleHost)) continue; BundleLoader loader = ((BundleHost) bundles[i]).getBundleLoader(); if (loader == null || loader.getBundle() == supplier.getBundle()) continue; // do not include include the exporter of the package PackageSource importerSource = loader.getPackageSource(getName()); if (supplierSource != null && supplierSource.hasCommonSource(importerSource)) importers.add(bundles[i]); } return importers.toArray(new Bundle[importers.size()]); }
public Bundle[] getImportingBundles() { if (supplier.isStale()) return null; AbstractBundle bundle = (AbstractBundle) getExportingBundle(); if (bundle == null) return null; AbstractBundle[] bundles = bundle.framework.getAllBundles(); List<Bundle> importers = new ArrayList<Bundle>(10); PackageSource supplierSource = supplier.createPackageSource(exportedPackage, false); for (int i = 0; i < bundles.length; i++) { if (!(bundles[i] instanceof BundleHost)) continue; BundleLoader loader = ((BundleHost) bundles[i]).getBundleLoader(); if (loader == null || loader.getBundle() == supplier.getBundle()) continue; // do not include include the exporter of the package PackageSource importerSource = loader.getPackageSource(getName()); if (supplierSource != null && supplierSource.hasCommonSource(importerSource)) importers.add(bundles[i]); } return importers.toArray(new Bundle[importers.size()]); }
final PackageSource createExportPackageSource(ExportPackageDescription export, KeyedHashSet visited) { BundleLoaderProxy exportProxy = getLoaderProxy(export.getExporter()); if (exportProxy == null) // TODO log error!! return null; PackageSource requiredSource = exportProxy.getBundleLoader().findRequiredSource(export.getName(), visited); PackageSource exportSource = exportProxy.createPackageSource(export, false); if (requiredSource == null) return exportSource; return createMultiSource(export.getName(), new PackageSource[] {requiredSource, exportSource}); }
final PackageSource createExportPackageSource(ExportPackageDescription export, KeyedHashSet visited) { BundleLoaderProxy exportProxy = getLoaderProxy(export.getExporter()); if (exportProxy == null) // TODO log error!! return null; PackageSource requiredSource = exportProxy.getBundleLoader().findRequiredSource(export.getName(), visited); PackageSource exportSource = exportProxy.createPackageSource(export, false); if (requiredSource == null) return exportSource; return createMultiSource(export.getName(), new PackageSource[] {requiredSource, exportSource}); }