public BundleWiring getBundleWiring() { return loader.getLoaderProxy().getBundleDescription().getWiring(); }
public BundleWiring getBundleWiring() { return loader.getLoaderProxy().getBundleDescription().getWiring(); }
/** * Adds a list of DynamicImport-Package manifest elements to the dynamic * import tables of this BundleLoader. Duplicate packages are checked and * not added again. * @param packages the DynamicImport-Package elements to add. */ public final synchronized void addDynamicImportPackage(ManifestElement[] packages) { if (packages == null) return; List<String> dynamicImports = new ArrayList<String>(packages.length); List<ImportPackageSpecification> dynamicImportSpecs = new ArrayList<ImportPackageSpecification>(packages.length); for (ManifestElement dynamicImportElement : packages) { String[] names = dynamicImportElement.getValueComponents(); for (String name : names) dynamicImports.add(name); StateBuilder.addImportPackages(dynamicImportElement, dynamicImportSpecs, 2, true); } if (dynamicImports.size() > 0) { addDynamicImportPackage(dynamicImports.toArray(new String[dynamicImports.size()])); BundleDescription revision = getLoaderProxy().getBundleDescription(); State state = revision.getContainingState(); state.addDynamicImportPackages(revision, dynamicImportSpecs.toArray(new ImportPackageSpecification[dynamicImportSpecs.size()])); } }
/** * Adds a list of DynamicImport-Package manifest elements to the dynamic * import tables of this BundleLoader. Duplicate packages are checked and * not added again. * @param packages the DynamicImport-Package elements to add. */ public final synchronized void addDynamicImportPackage(ManifestElement[] packages) { if (packages == null) return; List<String> dynamicImports = new ArrayList<String>(packages.length); List<ImportPackageSpecification> dynamicImportSpecs = new ArrayList<ImportPackageSpecification>(packages.length); for (ManifestElement dynamicImportElement : packages) { String[] names = dynamicImportElement.getValueComponents(); for (String name : names) dynamicImports.add(name); StateBuilder.addImportPackages(dynamicImportElement, dynamicImportSpecs, 2, true); } if (dynamicImports.size() > 0) { addDynamicImportPackage(dynamicImports.toArray(new String[dynamicImports.size()])); BundleDescription revision = getLoaderProxy().getBundleDescription(); State state = revision.getContainingState(); state.addDynamicImportPackages(revision, dynamicImportSpecs.toArray(new ImportPackageSpecification[dynamicImportSpecs.size()])); } }
ExportPackageDescription[] exports = proxy.getBundleDescription().getSelectedExports(); if (exports == null || exports.length == 0) eePackages = null;
ExportPackageDescription[] exports = proxy.getBundleDescription().getSelectedExports(); if (exports == null || exports.length == 0) eePackages = null;
static public void closeBundleLoader(BundleLoaderProxy proxy) { if (proxy == null) return; // First close the BundleLoader BundleLoader loader = proxy.getBasicBundleLoader(); if (loader != null) loader.close(); proxy.setStale(); // if proxy is not null then make sure to unset user object // associated with the proxy in the state BundleDescription description = proxy.getBundleDescription(); // must set it back to the bundle object; not null // need to make sure the user object is a BundleReference description.setUserObject(proxy.getBundleData()); } }
static public void closeBundleLoader(BundleLoaderProxy proxy) { if (proxy == null) return; // First close the BundleLoader BundleLoader loader = proxy.getBasicBundleLoader(); if (loader != null) loader.close(); proxy.setStale(); // if proxy is not null then make sure to unset user object // associated with the proxy in the state BundleDescription description = proxy.getBundleDescription(); // must set it back to the bundle object; not null // need to make sure the user object is a BundleReference description.setUserObject(proxy.getBundleData()); } }
public synchronized KeyedHashSet getImportedSources(KeyedHashSet visited) { if ((loaderFlags & FLAG_IMPORTSINIT) != 0) 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) importedSources.add(source); } } loaderFlags |= FLAG_IMPORTSINIT; return importedSources; }
public synchronized KeyedHashSet getImportedSources(KeyedHashSet visited) { if ((loaderFlags & FLAG_IMPORTSINIT) != 0) 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) importedSources.add(source); } } loaderFlags |= FLAG_IMPORTSINIT; return importedSources; }
synchronized public void attachFragment(BundleFragment fragment) throws BundleException { ExportPackageDescription[] exports = proxy.getBundleDescription().getSelectedExports(); if (classloader == null) { initializeExports(exports, exportedPackages); return; } String[] classpath = fragment.getBundleData().getClassPath(); if (classpath != null) classloader.attachFragment(fragment.getBundleData(), fragment.getProtectionDomain(), classpath); initializeExports(exports, exportedPackages); }
synchronized public void attachFragment(BundleFragment fragment) throws BundleException { ExportPackageDescription[] exports = proxy.getBundleDescription().getSelectedExports(); if (classloader == null) { initializeExports(exports, exportedPackages); return; } String[] classpath = fragment.getBundleData().getClassPath(); if (classpath != null) classloader.attachFragment(fragment.getBundleData(), fragment.getProtectionDomain(), classpath); initializeExports(exports, exportedPackages); }
private PackageSource findDynamicSource(String pkgName) { if (isDynamicallyImported(pkgName)) { 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; } } return null; }
private PackageSource findDynamicSource(String pkgName) { if (isDynamicallyImported(pkgName)) { 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; } } return null; }
throw new BundleException(Msg.BUNDLE_READ_EXCEPTION, e); BundleDescription description = proxy.getBundleDescription();
throw new BundleException(Msg.BUNDLE_READ_EXCEPTION, e); BundleDescription description = proxy.getBundleDescription();