Java Reference
In-Depth Information
URL
stream handlers and content handlers, based on implementations registered with
the
OSG
i service registry.
(CONDITIONAL) PERMISSION ADMIN SERVICE
Two
OSG
i services deal with permissions: the Permission Admin Service, which deals
with permissions granted to specific bundles, and the Conditional Permission Admin
Service, which provides a more general-purpose and fine-grained permission model
based on conditions. Both of these services build on the standard Java 2 security archi-
tecture. We'll discuss security more in chapter 14.
You now know which core services you can expect to see in an
OSG
i framework, but
what about the non-core compendium services? What sort of capabilities do they
cover?
4.6.2
Compendium services
In addition to the core services, the
OSG
i Alliance defines a set of non-core standard
services called the
compendium
services. Whereas the core services are typically avail-
able by default in a running
OSG
i framework, the compendium services aren't. Keep-
ing with the desire for modularity, you wouldn't want them to be included by default
because this would lead to bloated systems. Instead, these services are provided as sep-
arate bundles by framework implementers or other third parties and typically work on
all frameworks.
You've already seen one example of a compendium service: the Log Service from
section 4.3, which provides a simple logging
API
. This is one of the better-known com-
pendium services. Let's take a brief look at other popular examples.
HTTP SERVICE
The
OSG
i
HTTP
Service supports registration of servlets and resources under named
aliases. These aliases are matched against incoming
URI
requests, and the relevant
servlet or resource is used to construct the reply. You can authenticate incoming
requests using standard
HTTP
/
HTTPS
, the
OSG
i User Admin Service, or your own cus-
tom approach. The current
HTTP
Service is based on version 2.1 of the servlet specifi-
cation,
5
which means it doesn't cover servlet filters, event listeners, or JSPs. Later
versions of the
HTTP
Service specification should address this, and some implementa-
tions already support these additional features.
6
We'll talk more about the
HTTP
Ser-
vice and
OSG
i web applications in chapter 15.
EVENT ADMIN SERVICE
The
OSG
i Event Admin Service provides a basic publish-subscribe event model. Each
event consists of a topic, which is basically a semistructured string, and a set of proper-
ties. Event handlers are registered as services and can use metadata to describe which
topics and properties they're interested in. Events can be sent synchronously or asyn-
chronously and are delivered to matching event handlers by using the whiteboard
5
6
For example, Pax Web:
http://wiki.ops4j.org/display/paxweb
.