Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / examples / Event_Comm / Event_Comm.idl
blob92b24036dd6a7c442fcd34d39f95c49dc15010b2
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file Event_Comm.idl
7 * The CORBA IDL module for distributed event notification.
10 * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu) and Pradeep Gore (pradeep@cs.wustl.edu)
12 //=============================================================================
15 #if !defined (_EVENT_COMM_IDL)
16 #define _EVENT_COMM_IDL
18 module Event_Comm
20 // = TITLE
21 // The CORBA IDL module for distributed event notification.
23 struct Event
25 // = TITLE
26 // Defines the interface for an event <Event>.
28 // = DESCRIPTION
29 // This is the type passed by the Notifier to the Consumer.
30 // Since it contains an <any>, it can hold any type. Naturally,
31 // the consumer must understand how to interpret this!
33 string tag_;
34 // Tag for the event. This is used by the <Notifier> to compare
35 // with the <Consumer>s' filtering criteria.
37 any value_;
38 // An event can contain anything.
40 Object object_ref_;
41 // Object reference for callbacks.
44 interface Consumer
46 // = TITLE
47 // Defines the interface for a <Consumer> of events.
49 void push (in Event event_instance);
50 // Inform the <Consumer> that <event> has occurred.
52 void disconnect (in string reason);
53 // Disconnect the <Consumer> from the <Notifier>,
54 // giving it the <reason>.
57 interface Notifier
59 // = TITLE
60 // Defines the interface for a <Notifier> of events.
62 exception CannotSubscribe
64 // = TITLE
65 // This exception in thrown when a <subscribe> fails.
67 string reason_;
70 exception CannotUnsubscribe
72 // = TITLE
73 // This exception in thrown when a <unsubscribe> fails.
75 string reason_;
78 // = The following operations are intended for Suppliers.
80 void disconnect (in string reason);
81 // Disconnect all the receivers, giving them the <reason>.
83 void push (in Event event_instance);
84 // Send the <event> to all the consumers who have subscribed and
85 // who match the filtering criteria.
87 // = The following operations are intended for Consumers.
89 void subscribe (in Consumer subscriber,
90 in string filtering_criteria) raises (CannotSubscribe);
91 // Subscribe the <Consumer> to receive events that match the
92 // regular expresssion <filtering_criteria> applied by the
93 // <Notifier>. If <filtering_criteria> is "" then all events are
94 // matched.
96 void unsubscribe (in Consumer unsubscriber,
97 in string filtering_criteria) raises (CannotUnsubscribe);
98 // Unsubscribe the <Consumer> that matches the filtering criteria.
99 // If <filtering_criteria> is "" then all <Consumers> with the
100 // matching object reference are removed.
104 #endif /* _EVENT_COMM_IDL */