summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/CosEventComm.idl
blob: e97413fa618029d09994701e4b70add3d239864e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/**
 * @file CosEventComm.idl
 *
 * @brief Define the CosEventComm module
 *
 * $Id$
 *
 * Described in CORBAservices: Common Object Services Specification,
 * chapter 4.
 *
 * CosEventComm Module, page 4-8 includes the following interfaces:
 * PushConsumer, PushSupplier, PullSupplier, PullConsumer
 *
 * The Event service IDL can be downloaded from
 * ftp://www.omg.org/pub/docs/formal/97-11-02.idl
 *
 * The complete specification is available from:
 * http://www.omg.org/technology/documents/formal/event_service.htm
 *
 * @author Pradeep Gore <pradeep@cs.wustl.edu>
 */

#ifndef TAO_EVENTCOMM_IDL
#define TAO_EVENTCOMM_IDL

#pragma prefix "omg.org"

/**
 * @namespace CosEventComm
 *
 * @brief Define the interfaces implemented by users of the CORBA
 * Event Service.
 */
module CosEventComm
{
  /**
   * @exception Disconnected
   *
   * @brief Exception raised when a client tries to communicate with
   * the Event Service after it has disconnected.
   *
   * The exception is raised if:
   *
   * - If supplier tries to push an event before fully connecting to
   *   the EC.
   * - A consumer tries to pull an event before fully connecting to
   *   the EC.
   */
  exception Disconnected {};

  /**
   * @interface PushConsumer
   *
   * @brief Define the interface implemented by push-style consumers
   *
   * A push-style consumer passively receives events from the Event
   * Service.  Applications simply implement this interface, connect
   * to the Event Service and receive events.
   */
  interface PushConsumer
  {
    /// Receive one event from the Consumer's peer.
    /**
     * A supplier communicates event data to the consumer by
     * invoking the push operation.
     * @param data The event
     * @throws CosEventComm::Disconnected if the object considers
     *   itself no longer connected to its peer.
     */
    void push (in any data) raises (Disconnected);

    /// The peer has disconnected from the PushConsumer.
    /**
     * The disconnect_push_consumer operation indicates that the peer
     * has disconnected, for example, because it has been destroyed.
     * The application can safely release all resources attached to
     * this consumer and destroy it, no further push() calls should be
     * expected.
     */
    void disconnect_push_consumer ();
  };

  /**
   * @interface PushSupplier
   *
   * @brief Define the interface implemented by push-style suppliers.
   *
   * A push-style supplier actively pushes events into the Event
   * Service
   */
  interface PushSupplier
  {
    /// The peer has disconnected from the push-style supplier
    /**
     * The disconnect_push_supplier operation indicates that the peer
     * has disconnected, for example, because it has been destroyed.
     * The application can safe release all resource attached to this
     * supplier and destroy it, further attempts to push events into
     * its peer will fail.
     */
    void disconnect_push_supplier ();
  };

  /**
   * @interface PullConsumer
   *
   * @brief Define the interface implemented by pull-style consumers
   *
   * A pull-style consumer actively queries the Event Channel for
   * events.
   */
  interface PullConsumer
  {
    /// The peer has disconnected from the pull-style consumer.
    /**
     * The disconnect_pull_consumer operation indicates that the peer
     * has disconnected, for example, because it has been destroyed.
     * The application can safely release all resources attached to
     * this consumer and destroy it, any attemps to pull more data
     * should fail.
     */
    void disconnect_pull_consumer ();
  };

  /**
   * @interface PullSupplier
   *
   * @brief Define the interface implemented by pull-style suppliers.
   *
   * A pull-style supplier passively generates events for the Event
   * Service
   */
  interface PullSupplier
  {
    /// Pull (blocking) one event from the supplier.
    /**
     * The pull operation should block until the next event becomes
     * available.
     * @return The next event
     * @throws CosEventComm::Disconnected if the object considers
     *   itself no longer connected to its peer.
     */
    any pull () raises (Disconnected);

    /// Pull (non-blocking) one event from the supplier.
    /**
     * The try_pull operation does not block: if the event data is
     * available, it returns the event data and sets the has_event
     * parameter to true; if the event is not available, it sets the
     * has_event parameter to false and the event data is returned
     * as long with an undefined value.
     *
     * @param has_event Set to TRUE if there was another event
     *   available, FALSE otherwise.
     * @return The next event if one was available, an any containing
     *   a 'long' with an undefined value otherwise.
     * @throws CosEventComm::Disconnected if the object considers
     *   itself no longer connected to its peer.
     */
    any try_pull (out boolean has_event) raises (Disconnected);

    /// The peer has disconnected from the pull-style supplier.
    /**
     * The disconnect_pull_supplier operation indicates that the peer
     * has disconnected, for example, because it has been destroyed.
     * The application can safe release all resource attached to this
     * supplier and destroy it, the peer should not make any attempts
     * to pull more data after this request.
     */
    void disconnect_pull_supplier ();
  };

};

#pragma prefix ""

#endif /* TAO_EVENTCOMM_IDL */