org.knopflerfish.framework.Bundles Class Reference

List of all members.


Detailed Description

Here we handle all the bundles that are installed in the framework.

Also handles load and save of bundle states to file, so that we can restart the platform.

Author:
Jan Stein

Mats-Ola Persson

Definition at line 58 of file Bundles.java.


Public Member Functions

Bundle getBundle (long id)
 Get bundle that has specified bundle identifier.
Bundle getBundle (String location)
 Get bundle that has specified bundle location.

Package Functions

 Bundles (Framework fw)
 Create a container for all bundles in this framework.
BundleImpl install (final String location, final InputStream in) throws BundleException
 Install a new bundle.
void remove (String location)
 Remove bundle registration.
BundleImpl getBundle (String name, Version version)
 Get bundle that has specified bundle symbolic name and version.
List getBundles ()
 Get all installed bundles.
List getBundles (String name)
 Get all bundles that has specified bundle symbolic name.
List getBundles (String name, VersionRange range)
 Get all bundles that has specified bundle symbolic name and version range.
List getActiveBundles ()
 Get all bundles currently in bundle state ACTIVE.
synchronized void load ()
 Try to load any saved framework state.
void startBundles (List slist)
 Start a list of bundles in order.
List getFragmentBundles (BundleImpl target)
 Returns all fragment bundles that is already attached and targets given bundle.

Member Function Documentation

BundleImpl org.knopflerfish.framework.Bundles.install ( final String  location,
final InputStream  in 
) throws BundleException [package]

Install a new bundle.

Parameters:
location The location to be installed

Definition at line 86 of file Bundles.java.

References org.knopflerfish.framework.Listeners.bundleChanged(), org.knopflerfish.framework.PermissionOps.callInstall0(), org.knopflerfish.framework.Framework.listeners, and org.knopflerfish.framework.Framework.perm.

Referenced by org.knopflerfish.framework.Framework.installBundle(), and org.knopflerfish.framework.BundleContextImpl.installBundle().

void org.knopflerfish.framework.Bundles.remove ( String  location  )  [package]

Remove bundle registration.

Parameters:
location The location to be removed

Definition at line 173 of file Bundles.java.

Referenced by org.knopflerfish.framework.BundleImpl.purge().

Bundle org.knopflerfish.framework.Bundles.getBundle ( long  id  ) 

Get bundle that has specified bundle identifier.

Parameters:
id The identifier of bundle to get.
Returns:
BundleImpl representing bundle or null if bundle was not found.

Definition at line 185 of file Bundles.java.

References org.knopflerfish.framework.BundleImpl.id.

Referenced by org.knopflerfish.framework.BundleContextImpl.getBundle(), org.knopflerfish.framework.Framework.getBundleId(), org.knopflerfish.framework.Framework.getBundleLocation(), org.knopflerfish.framework.Framework.launch(), org.knopflerfish.framework.BundleClassLoader.purge(), org.knopflerfish.framework.Framework.shutdown(), org.knopflerfish.framework.Framework.startBundle(), org.knopflerfish.framework.Framework.stopBundle(), org.knopflerfish.framework.Framework.uninstallBundle(), and org.knopflerfish.framework.Framework.updateBundle().

Bundle org.knopflerfish.framework.Bundles.getBundle ( String  location  ) 

Get bundle that has specified bundle location.

Parameters:
location The location of bundle to get.
Returns:
BundleImpl representing bundle or null if bundle was not found.

Definition at line 205 of file Bundles.java.

BundleImpl org.knopflerfish.framework.Bundles.getBundle ( String  name,
Version  version 
) [package]

Get bundle that has specified bundle symbolic name and version.

Parameters:
name The symbolic name of bundle to get.
version The bundle version of bundle to get.
Returns:
BundleImpl for bundle or null.

Definition at line 217 of file Bundles.java.

References org.osgi.framework.Version.equals(), org.knopflerfish.framework.BundleImpl.symbolicName, and org.knopflerfish.framework.BundleImpl.version.

List org.knopflerfish.framework.Bundles.getBundles (  )  [package]

Get all installed bundles.

Returns:
A Bundle array with bundles.

Definition at line 235 of file Bundles.java.

Referenced by org.knopflerfish.framework.PackageAdminImpl.getBundles(), org.knopflerfish.framework.Bundles.getBundles(), org.knopflerfish.framework.BundleContextImpl.getBundles(), org.knopflerfish.framework.PackageAdminImpl.getExportedPackages(), org.knopflerfish.framework.PackageAdminImpl.getRequiredBundles(), org.knopflerfish.framework.PackageAdminImpl.refreshPackages(), org.knopflerfish.framework.PackageAdminImpl.resolveBundles(), and org.knopflerfish.framework.Framework.shutdown().

List org.knopflerfish.framework.Bundles.getBundles ( String  name  )  [package]

Get all bundles that has specified bundle symbolic name.

Parameters:
name The symbolic name of bundles to get.
Returns:
A List of BundleImpl.

Definition at line 250 of file Bundles.java.

References org.knopflerfish.framework.BundleImpl.symbolicName.

List org.knopflerfish.framework.Bundles.getBundles ( String  name,
VersionRange  range 
) [package]

Get all bundles that has specified bundle symbolic name and version range.

Result is sorted in decreasing version order.

Parameters:
name The symbolic name of bundles to get.
range Version range of bundles to get.
Returns:
A List of BundleImpl.

Definition at line 272 of file Bundles.java.

References org.osgi.framework.Version.compareTo(), org.knopflerfish.framework.Bundles.getBundles(), org.knopflerfish.framework.BundleImpl.version, and org.knopflerfish.framework.VersionRange.withinRange().

List org.knopflerfish.framework.Bundles.getActiveBundles (  )  [package]

Get all bundles currently in bundle state ACTIVE.

Returns:
A List of BundleImpl.

Definition at line 296 of file Bundles.java.

References org.knopflerfish.framework.BundleImpl.getState().

synchronized void org.knopflerfish.framework.Bundles.load (  )  [package]

Try to load any saved framework state.

This is done by installing all saved bundles from the local archive copy, and restoring the saved state for each bundle. This is only intended to be executed during the start of the framework.

Definition at line 318 of file Bundles.java.

References org.knopflerfish.framework.BundleStorage.getAllBundleArchives(), org.knopflerfish.framework.BundleImpl.location, and org.knopflerfish.framework.Framework.storage.

Referenced by org.knopflerfish.framework.Framework.Framework().

void org.knopflerfish.framework.Bundles.startBundles ( List  slist  )  [package]

Start a list of bundles in order.

Parameters:
slist Bundles to start.

Definition at line 332 of file Bundles.java.

References org.knopflerfish.framework.BundleImpl.framework, org.knopflerfish.framework.Listeners.frameworkError(), org.knopflerfish.framework.BundleImpl.getUpdatedState(), org.knopflerfish.framework.Framework.listeners, and org.knopflerfish.framework.BundleImpl.start().

List org.knopflerfish.framework.Bundles.getFragmentBundles ( BundleImpl  target  )  [package]

Returns all fragment bundles that is already attached and targets given bundle.

Parameters:
target the targetted bundle
Returns:
a list of all matching fragment bundles.

Definition at line 354 of file Bundles.java.

References org.knopflerfish.framework.BundleImpl.getFragmentHost(), org.knopflerfish.framework.BundleImpl.isFragment(), and org.knopflerfish.framework.BundleImpl.state.

Referenced by org.knopflerfish.framework.BundleImpl.attachFragments(), org.knopflerfish.framework.BundleImpl.findEntries(), and org.knopflerfish.framework.Framework.shutdown().


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