Chapter 3. Service Management Framework Runtime 43
and managed deployment of services. The primary targets for the OSGi
specifications are set top boxes, service gateways, cable modems, consumer
electronics, PCs, industrial computers, cars and more. These devices that
implement the OSGi specifications will enable service providers like telcos, cable
operators, utilities, and others to deliver differentiated and valuable services over
their networks.
The OSGi specification enables the separation of the service interface from the
service implementation, allowing scalability and extensibility. The SMF
framework uses the information in the bundle manifests to populate its service
registry and to manage and resolve bundle dependencies. Each bundle has it’s
own class loader and name space, and the references between bundles, to
access each others services, is managed by the framework.
There are tools designed specifically for bundle creation and management. Many
are wizard-based, to allow you to easily create the required classes, methods
and other template code for your packages, whereupon you then write the core
logic to those services. WebSphere Device Developer is extended by a number
of tools including the Bundle Development Kit and the other Extension Services
tools. There is also a reference platform for the tooling that includes a bundle
server for testing your code without the need for a production level server.
In sum, the OSGi platform is designed to enable devices of any shape and size
to execute a consistent, modular program model, on a well-architected set of
frameworks and core services. This framework provides services and bundle life
cycle management to enable dynamic loading, starting and stopping, and more
importantly, bundle and service sharing in the VM instance that is running the
SMF platform.
3.1.2 What is SMF?
The Service Management Framework (SMF) Runtime is IBM’s implementation of
the OSGi Service Platform.
SMF is a Java application, running in a JVM. In essence, SMF is the host
environment in which the bundles execute. It manages the life cycle of bundles
(installing, starting, stopping, updating and uninstalling) and through the bundle
manifest, the dependencies of bundles on one another. These bundles can
represent several separate applications or portions of applications, all running in
the same JVM.
Core and custom bundles
Core bundles provide the basic functionality of the platform. More simply, system
bundles are the SMF platform itself, and custom bundles are the ones you and
44 WCTME: Application Development and Case Study
other developers create to extend the framework and to form applications to
perform other useful problem solving tasks.
Custom bundles can be created to expose new interfaces or Java packages and
new services. For our sample application and case study, we created several
custom bundles. Applications are constructed by using these services and
interfaces. Each of these bundles can be managed separately, each having their
own life cycle. Bundles can be installed into the framework; started, stopped, and
updated independently of each other.
Bundles can implement an interface, BundleActivator, that allows the bundle to
be started and stopped cleanly by the framework. During the start and stop calls,
the bundle activator logic is called to manage the bundle, which can include the
registering or un-registering of a service, starting and stopping threads, and
allocation and de-allocation of resources.
Bundles must include a manifest file that includes information used by the
framework to install and activate the bundle and determine dependencies
between bundles. Import dependencies and export definitions of packages and
services are described in the manifest file.
Running the framework
You can run the SMF Runtime inside the WebSphere Device Developer
workspace (see the SMF Bundle Developer Tools documentation) and from a
command line.
Consult the following sections of the SMF Runtime documentation in Table 3-1
for detailed information concerning the execution of the SMF runtime:
Table 3-1 SMF Runtime documentation
Tip: See the SMF Bundle Developer Tools documentation and the SMF
Bundle Server documentation, especially the Documentation and Web Links,
for more information about development, life cycle and bundle management.
smf.properties Service Management Framework
򐂰 SMF Runtime User’s Guide
򐂰 Getting Started
򐂰 Getting Started with the SMF Runtime
򐂰 Using the smf.properties file

Get IBM Workplace Client Technology Micro Edition Version 5.7.1: Application Development and Case Study now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.