Java Reference
In-Depth Information
Table 13.1
Some standard OSGi framework configuration properties
(continued)
Property name
Spec
Meaning
R4.2
Specifies a comma-separated list
of additional library file exten-
sions that must be used when
searching for native code.
org.osgi.framework.library.extensions
org.osgi.framework.command.execpermission
R4.2
Specifies an optional OS-specific
command to set file permissions
on a bundle's native code.
property names are case insensitive. We won't go into the precise details of all the stan-
dard configuration properties, so consult the R4.2 specification if you want details not
covered here. With this knowledge, you know how to configure and instantiate a
framework instance; let's look at how to start it.
13.1.4
Starting a framework instance
When you have a
Framework
instance from
FrameworkFactory
, starting it is easy:
invoke the
start()
method inherited from the
Bundle
interface. The
start()
method implicitly initializes the framework by invoking the
Framework.init()
method, unless you explicitly initialize it beforehand. If the
init()
method wasn't
invoked prior to calling
start()
, then it's invoked by
start()
.
You can relate these methods to the framework lifecycle transitions, similar to the
normal bundle lifecycle:
■
init()
transitions the framework instance to the
Bundle.STARTING
state.
■
start()
transitions the framework instance to the
Bundle.ACTIVE
state.
The
init()
method gets the framework ready but doesn't start executing any bundle
code yet. It performs the following steps:
1
Framework event handling is enabled.
2
The security manager is installed if it's enabled.
3
The framework start level is set to 0.
4
All cached bundles are reloaded, and their state is set to
Bundle.INSTALLED
.
5
A
BundleContext
object is created for the framework.
6
All framework-provided services are made available (Package Admin, Start
Level, and so on).
7
The framework enters the
Bundle.STARTING
state.
The
start()
method starts the framework instance and performs the following addi-
tional steps: