The Community OpenORB - Event Service

Olivier Modica

Shawn Boyce


Table of Contents

Introduction
1. Overview
2. Compilation
3. Installation
4. Configuration
5. Deployment
Using the Event Channel Factory
How to get the EventChannelFactory
How to get the DefaultEventChannel
How to launch the Event Service
How to launch the Event Service examples
6. Frequently Asked Questions
A. Appendix

Introduction

This document provides all information on how to download, install, run and test the OpenORB EventService.

Chapter 1. Overview

The Event Service is specified to provide decoupled event exchanges between CORBA objects known as suppliers and consumers. OpenORB Event is a fully compliant implementation of the OMG Event Service specification.

CORBA objects can exchange events through an event channel using either PUSH or PULL models. The Event Service specification provides only one event channel. OpenORB Event extends the specification to meet developers requirements and allows to create several event channels.

An event is a set of information of any kind, which is implemented by a CORBA Any type. A supplier is a CORBA object that produces events and sends them to the Event Channel. A consumer is a CORBA object that consumes the events sent over the Event Channel. That is, a consumer will receive all events that were sent to the channel.

The specification supports 2 models. With the PUSH model, the supplier takes the initiative of emitting its event, and a consumer receives the event whenever the event is available. With the PULL model, the supplier doesn't take the initiative of emitting the event, and is asked for emiting one if any event is available. That way, a consumer may query for an event whenever it decides to. By decoupling suppliers and consumers, the Event Channel allows different kind of suppliers and consumers using different models to cooperate.

The OpenORB Event Service allows event channel creation by exporting a factory in the Naming Service.

Chapter 2. Compilation

You need the OpenORB distribution to run the Event Service.

The Event Service distribution contains a Ant script. If you use the build.bat (for windows) or build.sh (for unix) all required dependencies and classpath are provided.

Thus, to compile the OpenORB Event Service, we advise you to enter the following from the command line : build ( windows ) or sh build.sh ( unix )

You will find the openorb_event-{version}.jar and openorb_event_examples-{version}.jar files in the dist directory. and you will find the event.html documentation in the doc directory.

Chapter 3. Installation

This chapter explains how to install the Event Service. We remind you that OpenORB must be installed before proceeding to the next steps.

To get the OpenORB Event Service, visit the OpenORB web site ( openorb.sf.net ). Then, go to the download section. Follow the instructions to download the Event Service.

Chapter 4. Configuration

Chapter 5. Deployment

Using the Event Channel Factory

This interface is not defined by the OMG but is an extension provided by OpenORB Event Service. Indeed this interface provides a way to create several event channels. Here is a description of the methods of the interface.

How to get the EventChannelFactory

The EventChannelFactory can be retrieved by resolving the COS/EventService/EventChannelFactory NamingService binding. This will return a reference to the EventChannelFactory interface.

The following code will resolve the EventChannelFactory. org.omg.CORBA.Object obj = orb.string_to_object("corbaname:rir:#COS/EventService/EventChannelFactory"); org.openorb.event.EventChannelFactory factory = org.openorb.event.EventChannelFactoryHelper.narrow( obj );

How to get the DefaultEventChannel

The OpenORB Event Service provides a default event channel that doesn't need to be created and is available for any application. The DefaultEventChannel can be retrieved by resolving the COS/EventService/DefaultEventChannel NamingService binding. This will return a reference to the org.omg.CosEventChannelAdmin.EventChannel interface.

The following code will resolve the DefaultEventChannel. org.omg.CORBA.Object obj = orb.string_to_object("corbaname:rir:#COS/EventService/DefaultEventChannel"); org.omg.CosEventChannelAdmin.EventChannel channel = org.omg.CosEventChannelAdmin.EventChannelHelper.narrow( obj );

How to launch the Event Service

To launch the example, you first have the Naming Service running: java org.openorb.util.MapNamingContext -ORBPort=2001 2001 is an example, please see the OpenORB guide for more details.

How to launch the Event Service examples

Then you can start the Event Service server: java org.openorb.event.Server

Then start the PUSH model example: Start the PushServer java org.openorb.event.examples.PushServer Start the PushClient java org.openorb.event.examples.PushClient

And start the PULL model example: Start the PullServer java org.openorb.event.examples.PullServer Start the PullClient java org.openorb.event.examples.PullClient

These examples demonstrate the different ways to use the Event Channel, and the different suppliers and consumers relative to their event model ( PUSH or PULL ).

Chapter 6. Frequently Asked Questions

Set

6.1. ?
6.1.

?

!

Appendix A. Appendix