The component model's execution environment, which is depicted in
figure 1, is composed by a Java virtual machine, the OSGi framework and
the ServiceBinder itself. The ServiceBinder is delivered inside a
(~70K) which makes it OSGi implementation independent.
ServiceBinder's bundle exports a package that contains the
class that makes it unnecessary to write code for the
bundle activator (only an empty subclass needs to be provided). The
generic activator parses the component descriptor file and creates the
instance managers that correspond to every component entry in the
descriptor. The component descriptor is located through a new property
defined inside the bundle manifest, the Metadata-Location
Subclassing the GenericActivator and writing a component
descriptor is all that is needed to create a component whose
dependencies are managed by the ServiceBinder.
Import-Package: org.ungoverned.gravity.servicebinder; specification-version="1.1.0"
public class Activator extends GenericActivator
The concepts presented here are completely compatible with standard
OSGi, as the services provided by component instances can be used by
OSGi bundles, and component instances can use services provided by
standard OSGi bundles.
To use the
ServiceBinder, it is not necessary to activate is. Activating this
bundle results, however, in the registration of an ArchitectureService,
that allows the architecture of the running application to be
introspected. Figure 3 shows and architecture viewer that displays the
structure of the running application. This viewer can be obtained from
the download pages and is installed as a
separate bundle. Usage of the ArchitecureService is discussed later in
Next : Using the service binder
Previous : Instance management