org.knopflerfish.framework.Packages Class Reference

List of all members.


Detailed Description

Here we handle all the java packages that are imported and exported within the framework.

Author:
Jan Stein, Erik Wistrand

Definition at line 48 of file Packages.java.


Package Functions

 Packages (Framework fw)
 Construct Packages object.
synchronized void registerPackages (Iterator exports, Iterator imports)
 Register all packages a bundle needs to export and import.
synchronized ExportPkg registerDynamicImport (ImportPkg ip)
 Dynamically check and register a dynamic package import.
synchronized boolean unregisterPackages (List exports, List imports, boolean force)
 Unregister bundle packages in framework.
synchronized String resolve (BundleImpl bundle, Iterator pkgs)
 Try to resolve all packages for a bundle.
Pkg getPkg (String pkg)
 Get Pkg object for named package.
synchronized Collection getZombieAffected (Bundle[] bundles)
 Get bundles affected by zombie packages.

Package Attributes

final Framework framework
 Framework for bundle.

Member Function Documentation

synchronized void org.knopflerfish.framework.Packages.registerPackages ( Iterator  exports,
Iterator  imports 
) [package]

Register all packages a bundle needs to export and import.

If it is registered by the system bundle, export it immediately.

Parameters:
exports Exported packages.
imports Imported packages.

Definition at line 105 of file Packages.java.

References org.knopflerfish.framework.Pkg.addExporter(), org.knopflerfish.framework.Pkg.addImporter(), org.knopflerfish.framework.ImportPkg.name, and org.knopflerfish.framework.ExportPkg.name.

Referenced by org.knopflerfish.framework.BundlePackages.attachFragment(), and org.knopflerfish.framework.BundlePackages.registerPackages().

synchronized ExportPkg org.knopflerfish.framework.Packages.registerDynamicImport ( ImportPkg  ip  )  [package]

Dynamically check and register a dynamic package import.

Parameters:
pe ImportPkg import to add.
Returns:
ExportPkg for package provider.

Definition at line 139 of file Packages.java.

References org.knopflerfish.framework.Pkg.addImporter(), org.knopflerfish.framework.ImportPkg.bpkgs, org.knopflerfish.framework.BundlePackages.bundle, org.knopflerfish.framework.ImportPkg.name, org.knopflerfish.framework.ImportPkg.provider, and org.knopflerfish.framework.Pkg.removeImporter().

Referenced by org.knopflerfish.framework.BundlePackages.getDynamicProviderBundlePackages().

synchronized boolean org.knopflerfish.framework.Packages.unregisterPackages ( List  exports,
List  imports,
boolean  force 
) [package]

Unregister bundle packages in framework.

If we find exported packages that has been selected as providers don't unregister them unless the parameter force is true. If not all exporters were removed, the don't remove any importers

Parameters:
exports Exported packages.
imports Imported packages.
force If true force unregistration of package providers.
Returns:
True if all packages were succesfully unregistered, otherwise false.

Definition at line 188 of file Packages.java.

References org.knopflerfish.framework.ImportPkg.bpkgs, org.knopflerfish.framework.ExportPkg.bpkgs, org.knopflerfish.framework.Pkg.importers, org.knopflerfish.framework.Pkg.isEmpty(), org.knopflerfish.framework.ImportPkg.name, org.knopflerfish.framework.ExportPkg.name, org.knopflerfish.framework.ImportPkg.pkg, org.knopflerfish.framework.ExportPkg.pkg, org.knopflerfish.framework.ImportPkg.pkgString(), org.knopflerfish.framework.ImportPkg.provider, org.knopflerfish.framework.Pkg.providers, org.knopflerfish.framework.Pkg.removeExporter(), and org.knopflerfish.framework.Pkg.removeImporter().

Referenced by org.knopflerfish.framework.BundlePackages.unregisterPackages().

synchronized String org.knopflerfish.framework.Packages.resolve ( BundleImpl  bundle,
Iterator  pkgs 
) [package]

Try to resolve all packages for a bundle.

Parameters:
bundle Bundle owning packages.
pkgs List of packages to be resolved.
Returns:
String with reason for failure or null if all were resolved.

Definition at line 244 of file Packages.java.

References org.knopflerfish.framework.Packages.framework, org.knopflerfish.framework.Listeners.frameworkError(), and org.knopflerfish.framework.Framework.listeners.

Referenced by org.knopflerfish.framework.BundlePackages.resolvePackages().

Pkg org.knopflerfish.framework.Packages.getPkg ( String  pkg  )  [package]

Get Pkg object for named package.

Parameters:
pkg Package name.
Returns:
Pkg that represents the package, null if no such package.

Definition at line 306 of file Packages.java.

Referenced by org.knopflerfish.framework.PackageAdminImpl.getExportedPackage(), org.knopflerfish.framework.PackageAdminImpl.getExportedPackages(), and org.knopflerfish.framework.ServiceReferenceImpl.isAssignableTo().

synchronized Collection org.knopflerfish.framework.Packages.getZombieAffected ( Bundle[]  bundles  )  [package]

Get bundles affected by zombie packages.

Compute a graph of bundles starting with the specified bundles. If no bundles are specified, compute a graph of bundles starting with all exporting a zombie package. Any bundle that imports a package that is currently exported by a bundle in the graph is added to the graph. The graph is fully constructed when there is no bundle outside the graph that imports a package from a bundle in the graph. The graph may contain UNINSTALLED bundles that are currently still exporting packages.

Parameters:
bundles Initial bundle set.
Returns:
List of bundles affected.

Definition at line 326 of file Packages.java.

References org.knopflerfish.framework.ExportPkg.bpkgs, org.knopflerfish.framework.BundlePackages.bundle, org.knopflerfish.framework.BundleImpl.getBundleId(), org.knopflerfish.framework.BundleImpl.getExports(), org.knopflerfish.framework.BundleImpl.getFragmentHost(), org.knopflerfish.framework.ExportPkg.getPackageImporters(), org.knopflerfish.framework.BundleImpl.getStartLevel(), org.knopflerfish.framework.BundleImpl.isAttached(), org.knopflerfish.framework.BundleImpl.isFragment(), org.knopflerfish.framework.ExportPkg.pkg, org.knopflerfish.framework.Pkg.providers, and org.knopflerfish.framework.ExportPkg.zombie.


The documentation for this class was generated from the following file:
Generated on Mon Jan 11 21:19:19 2010 for OpenMobileIS by  doxygen 1.5.4