-
Book Overview & Buying
-
Table Of Contents
Eclipse Plug-in Development Beginner's Guide - Second Edition
By :
To register a service, an instance of the implementation class needs to be created and registered with the framework. Interactions with the framework are performed with a BundleContext—typically provided in the BundleActivator.start method and stored for later use, or resolved dynamically from FrameworkUtil.getBundle().getBundleContext().
A bundle's activator is a class that is instantiated and coupled to the lifetime of the bundle. When a bundle is started, if a manifest entry Bundle-Activator exists, then the corresponding class is instantiated. As long as it implements the BundleActivator interface, the start method will be called. This method is passed an instance of BundleContext, which is the bundle's connection back to the hosting OSGi framework.
Although creating an activator may seem a simple way of registering a service, it is better to use declarative services, which are covered later in this appendix...
Change the font size
Change margin width
Change background colour