concept BundleContext in category osgi

This is an excerpt from Manning's book OSGi in Action: Creating Modular Applications in Java.
You may wonder what the single parameter of type BundleContext in the start() and stop() methods is all about. This is how the bundle gets access to the OSGi framework in which it’s executing. From this context object, the module has access to all the OSGi functionality for modularity, lifecycle, and services. In short, it’s a fairly important object for most bundles, but we’ll defer a detailed introduction of it until later when we discuss the lifecycle layer. The important point to take away from this example is that bundles have a simple way to hook into their lifecycle and gain access to the underlying OSGi framework.
In section 3.2.4, we’ll investigate the key API interfaces used by the OSGi lifecycle: BundleActivator, BundleContext, and Bundle.
Now you’ve seen how you can handle starting and stopping a bundle, but what if you want to interact with the OSGi framework? We’ll now switch the focus to the BundleContext object passed into the start() and stop() methods of the activator; this allows a bundle to interact with the framework and manage other bundles.
We’re interested in the first category of methods, because they give you the ability to install and manage the lifecycle of other bundles, access information about the framework, and retrieve basic configuration properties. This listing captures these methods from BundleContext.
Listing 3.2. BundleContext methods related to lifecycle management
public interface BundleContext { ... String getProperty(String key); Bundle getBundle(); Bundle installBundle(String location, InputStream input) throws BundleException; Bundle installBundle(String location) throws BundleException; Bundle getBundle(long id); Bundle[] getBundles(); void addBundleListener(BundleListener listener); void removeBundleListener(BundleListener listener); void addFrameworkListener(FrameworkListener listener); void removeFrameworkListener(FrameworkListener listener); ... }