Callback Example Using oneway Operations

The example in this section is based on the RecycleBroker IDL described in Chapter 3, “A Sample CORBA System.” Listing 9.3 shows an enhancement to the RecycleBroker system that enables users of the system to be notified as soon as a new waste item is offered for sale.

Listing 9.3. IDL for a Callback That Uses a oneway Operation
//IDL module RecycleBroker { typedef long KeyType; enum WasteType { BROWN_GLASS, GREEN_GLASS, CLEAR_GLASS, SCRAP_STEEL, ALUMINIUM_CANS, PLASTIC_BOTTLES, WASTE_PAPER }; // Implemented by the Client. interface WasteItemCallback { oneway void notify(in KeyType wasteitem_id, in WasteType waste); }; // Implemented by the Server. interface WasteItemRegister { void reg_callback(in WasteItemCallback ...

Get Pure CORBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.