Event Service
Summary by Peter Jacobs
Implementation by Tawee Pimsarn
This review of the CORBA Event Service contains a summary and an implementation.
Summary
The OrbixEvents Programmer’s Guide from IONA Technologies PLC was used to prepare this summary.
The guide is available from IONA’s site at http://www.iona.com or by downloading it directly in Adobe Acrobat Reader format.
Summary Contents
- Communicating Indirectly
- Event Transfer And Communication
- Event Example
- Programming Interface
- Untyped Push
- Untyped Pull
- Typed Push
- Typed Pull
Typed Pull
Four IDL interfaces support connection to and disconnection from the event channel for the Pull method:
- TypedPullSupplier
- PullConsumer
- ProxyPullConsumer
- TypedProxyPullSupplier
TypedPullSupplier and ProxyPullConsumer allow typed pull suppliers to connect to an event channel, and PullConsumer and TypedProxyPullSupplier are the interfaces for typed pull consumers. The untyped Pull method also refers to ProxyPullConsumer and PullConsumer.
A typed pull consumer initiates a connection to the event channel by obtaining a reference to an object of type TypedProxyPullSupplier in the channel. If the consumer wants to be notified if the event channel terminates the connection, it invokes the connect_pull_consumer() operation on the TypedProxyPullSupplier object, passing it a reference to an object of type PullConsumer as an operation parameter.
 |
Typed pull supplier and pull consumer connect to event channel. |
A reference to TypedProxyPullSupplier is obtained through event channel administration. After a TypedEventChannel reference is obtained, a for_consumers() is invoked on TypedEventChannel for a reference to a TypedConsumerAdmin object. obtain_typed_pull_supplier() is then invoked on TypedConsumerAdmin.
Typed pull suppliers connect by first obtaining a reference to a ProxyPullConsumer object implented in the channel. The supplier then invokes the connect_pull_supplier() operation on the ProxyPullConsumer and passes a reference to TypedPullSupplier.
Event channel administration is used to obtain the initial reference to ProxyPullConsumer. A for_suppliers() is performed on TypedEventChannel after a TypedEventChannel reference is obtained. A reference to TypedSupplierAdmin is returned and obtain_typed_pull_consumer() is then performed on TypedSupplierAdmin.
Event transfer begins when the consumer invokes a get_typed_supplier() operation on the event channel’s TypedProxyPullSupplier object. The TypedProxyPullSupplier object is of type agreed on by the consumer and the event channel during event channel administration. A reference to CORBA::Object is returned and the consumer must narrow this to a typed object reference it has instructions for. With this object reference, it can pull events from the channel by invoking operations in the constructed interface on the TypedProxyPullSupplier object.
 |
Typed pull transfer through event channel. |
After invoking a defined pull operation, the consumer will block until the event channel supplies an event. If it does not already have an event, the event channel in turn invokes a corresponding pull on the TypedPullSupplier object in each registered supplier. The event channel then blocks until some supplier supplies an event.
The consumer may poll the event channel by invoking a defined try_pull operation on the TypedProxyPullSupplier object. Depending on whether or not a supplier has an event, true or false is returned in the out parameter.
Summary Contents
- Communicating Indirectly
- Event Transfer And Communication
- Event Example
- Programming Interface
- Untyped Push
- Untyped Pull
- Typed Push
- Typed Pull