Previous Topic

Next Topic

Book Contents

Book Index

Event Admin Service

The Event Admin Service provides a publish-subscribe model for handling events. It is implemented according to the OSGi Event Admin Service Specification.

Overview

The Event Admin Service dispatches events between Event Publishers and Event Handlers through interposing an event channel. Publishers provide events to the channel and the event channel determines which handlers need to be notified. Thus publishers and handlers have no direct knowledge of each other, which simplifies the event management.

  1. Event Admin – Event broker, which is responsible for the event delivery.
  2. Event Publisher – The Event publisher is completely decoupled from the handlers.
  3. Event Handlers – Handlers receive events without direct knowledge of the publisher.

Events

An event is represented by an org.osgi.service.event.Event object. It has two attributes: topic and properties.

There are two ways in which events can be delivered: synchronous and asynchronous.

Additional Checks on the Event Properties

EventPropertiesPermission allows the Event Admin to check the sender and the receiver of the event based on the event properties of the event to be sent/delivered. Note, that this check is additional to the standard check for the org.osgi.service.event.TopicPermission with target the topic of the event.

An EventPropertiesPermission consists of a filter which should be matched against event properties and an action.

EventPropertiesPermission has two actions: PUBLISH and SUBSCRIBE.

By default the permission checks on event properties are disabled, so that the current software can work in a compliance with the OSGi R5 specification. Setting the mbs.eventadmin.eventProps.strict system property to true, enables the Event Admin bundle to make these additional checks on the event properties while sending/posting and receiving of events.

Registering Bundle

This service is registered by OSGi Event Admin Bundle.