Bundle Activator Wizard
Building bundles using SAT involves creating subclasses of the
BaseBundleActivator class. While this is certainly not
complicated, it is made easier with the help of the Bundle Activator
Wizard.
The Bundle Activator Wizard creates a bundle activator by subclassing
BaseBundleActivator and generates skeleton code based on
selections made by the user.
Using the Bundle Activator Wizard involves the following steps:
-
Create a Plug-in Project: A bundle is created using the PDE's
Plug-in Project type. A new project should be created for each new
bundle you wish to create. Convention dictates that the project's name
should be set to that of the bundle's
Bundle-SymbolicName.
-
Writing the Application Code: This is the Java application code
that will reside in the bundle. This code typically has no dependency
upon the OSGi framework. While it is not necessary to have all the
code written before the bundle activator is created, the application
model code is typically written to some degree first.
-
Creating a Bundle Activator: From the workbench menu bar choose
File > New > Other.... From the dialog box, expand the
Service Activator Toolkit folder then choose Bundle
Activator. Finally click Next > to open the wizard. The
wizard consists of 4 pages, each of which asks the user to enter
information about the bundle that they are building. The last page of
the wizard presents a preview of the code that will be generated when
the Finish button is clicked.
-
Updating the Bundle's Dependencies: After creating a bundle
activator the bundle will likely be referencing additional packages and
it will be necessary to update the bundle's manifest to reflect these
new dependencies. It is therefore always necessary to open the
Manifest Editor, turn to the
Dependencies page and update the Required Bundles and/or
Imported Packages sections. It is highly recommended that the
Manifest Editor's Automated Management of Dependencies section be
used to compute these new dependencies.
The following pages describe the Bundle Activator Wizard pages in detail.
Copyright © 2001, 2007 IBM Corporation and others. All Rights Reserved.