Java Reference
In-Depth Information
and clean. Almost all extensions to OSG i have been specified as optional add-on ser-
vices without requiring any changes to the core specification. These standard OSG i
services are divided into two categories: core and compendium. We'll take a quick
look at some of the core and compendium services in the next two subsections (see
table 4.3).
Table 4.3
Standard OSGi services covered in this section
Service
Type
Description
Package Admin
Core
Manages bundle updates and discovers who exports what
Start Level
Core
Queries and controls framework and bundle start levels
URL Handlers
Core
Handles dynamic URL streams
Permission Admin
Core
Manages bundle and service permissions
HTTP
Compendium
Puts simple servlets and resources onto the web
Event Admin
Compendium
Provides a topic-based publish-subscribe event model
Configuration Admin
Compendium
Manages and persists configuration data
User Admin
Compendium
Performs role-based authentication and authorization
4.6.1
Core services
The following core services are generally implemented by the OSG i framework itself,
because they're intimately tied to framework internals.
PACKAGE ADMIN SERVICE
The OSG i Package Admin Service, which we discussed in chapter 3, provides a selec-
tion of methods to discover details about exported packages and the bundles that
export and/or import them. You can use this service to trace dependencies between
bundles at execution time, which can help when upgrading because you can see what
bundles may be affected by the update. The Package Admin Service also provides
methods to refresh exported packages, which may have been removed or updated
since the last refresh, and to explicitly resolve specific bundles.
START LEVEL SERVICE
The OSG i Start Level Service lets you programmatically query and set the start level for
individual bundles as well as the framework itself, which allows you to control the rela-
tive order of bundle activation. You can use start levels to deploy an application or roll
out a significant update in controlled stages. We'll discuss this more in chapter 10.
URL HANDLERS SERVICE
The OSG i URL Handlers Service adds a level of dynamism to the standard Java URL
process. The Java specification unfortunately only allows one URLStreamHandler-
Factory to be set during the lifetime of a JVM , so the framework attempts to set its
own implementation at startup. If this is successful, this factory dynamically provides
 
Search WWH ::




Custom Search