summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/RtecEventChannelAdmin.idl
blob: 13cda1da364a6de72766a862548331282ba9a2cb (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
178
179
180
// $Id$

#ifndef TAO_RTEC_EVENTCHANNELADMIN_IDL
#define TAO_RTEC_EVENTCHANNELADMIN_IDL

#include "RtecEventComm.idl"
#include "RtecScheduler.idl"

module RtecEventChannelAdmin
{
  exception AlreadyConnected {};
  exception TypeError {};

  struct Dependency
  {
    RtecEventComm::Event event;
    RtecScheduler::handle_t rt_info;
  };
  typedef sequence<Dependency> DependencySet;

  struct ConsumerQOS
  {
    DependencySet dependencies;
    boolean is_gateway;
  };

  struct Publication
  {
    RtecEventComm::Event event;
    RtecScheduler::Dependency_Info dependency_info;
  };
  typedef sequence<Publication> PublicationSet;

  struct SupplierQOS
  {
    PublicationSet publications;
    boolean is_gateway;
  };

  interface ProxyPushSupplier: RtecEventComm::PushSupplier
    {
      // = TITLE
      //   The Proxy Supplier
      //
      // = DESCRIPTION
      //   Consumers receive their events from objects of this type. See
      //   the interfaces below to see how to gain access to an object
      //   reference of this type.

      void connect_push_consumer(in RtecEventComm::PushConsumer push_consumer,
                                 in ConsumerQOS qos)
        raises(AlreadyConnected, TypeError);
      // Before receiving any events the consumer must provide its
      // publication list and QoS information to the Event Channel
      // through this method.

      void suspend_connection ();
      // Temporarly suspend reception of events from the Event
      // Channel. Calling this method is more efficient than dropping
      // them on the receiving end and less expensive than disconnecting
      // and connecting again (but it is not free!!)

      void resume_connection ();
      // Resume the reception of events.
    };

  interface ProxyPushConsumer: RtecEventComm::PushConsumer
    {
      // = TITLE
      //   The Proxy Consumer
      //
      // = DESCRIPTION
      //   Suppliers push their events to objects of this type. See the
      //   interfaces below to see how to gain access to an object
      //   reference of this type.

      void connect_push_supplier (in RtecEventComm::PushSupplier push_supplier,
                                  in SupplierQOS qos)
        raises (AlreadyConnected);
      // Before pushing events the supplier must provide its
      // publication list and QoS information to the Event Channel
      // through this method.
    };

  // @@ TODO: Find out the exception specs for the following interface's
  // methods.
  interface ConsumerAdmin
    {
      // = TITLE
      //   The Supplier factory
      //
      // = DESCRIPTION
      //   Consumers use this interface to create suppliers they can
      //   connect to.

      ProxyPushSupplier obtain_push_supplier ();
      // Obtain a supplier
    };

  interface SupplierAdmin
    {
      // = TITLE
      //   The Consumer factory
      //
      // = DESCRIPTION
      //   Suppliers use this interface to create consumers they can
      //   connect to.

      ProxyPushConsumer obtain_push_consumer ();
      // Obtain a consumer
    };

  interface Observer
    {
      // = TITLE
      //   Observes any changes in the consumer or supplier sets for an
      //   Event Channel
      //
      // = DESCRIPTION
      //   This object receives updates from Event Channels with any
      //   changes on set of consumer and or suppliers registered with
      //   the Event Channel.

      void update_consumer (in ConsumerQOS sub);
      // A change in the list of consumers has ocurred. The disjunction
      // of the subscriptions is passed to the observer.

      void update_supplier (in SupplierQOS pub);
      // A change in the list of suppliers has ocurred. The disjunction
      // of the publications is passed to the observer.
    };

  typedef unsigned long Observer_Handle;
  // This is used as an opaque ID to control the addition and removal
  // of handles from an event channel.

  interface EventChannel
    {
      // = TITLE
      //   The Event Channel class
      //
      // = DESCRIPTION
      //   This class provides the main entry point for the Event
      //   Channel.  The class follows a protocol similar to the
      //   COS Event Service as described in the CORBAservices spec.
      //
      exception SYNCHRONIZATION_ERROR {};
      exception QOS_ERROR {};
      exception SUBSCRIPTION_ERROR {};
      exception CORRELATION_ERROR {};
      exception DISPATCH_ERROR {};
      exception CANT_APPEND_OBSERVER {};
      exception CANT_REMOVE_OBSERVER {};

      ConsumerAdmin for_consumers ();
      // Consumers call this method to gain access to the
      // ProxyPushSupplier factory.

      SupplierAdmin for_suppliers ();
      // Suppliers call this method to gain access to the
      // ProxyPushConsumer factory.

      void destroy ();
      // This method shutdown the Event Channel, destroy any resources
      // for it and actually shutdown the server where the Event Channel
      // is running.

      Observer_Handle append_observer (in Observer gw)
        raises (SYNCHRONIZATION_ERROR,CANT_APPEND_OBSERVER);
      // Add a gateway to the Event Channel, the handle returned must be
      // used to remove the gateway from the ORB.

      void remove_observer (in Observer_Handle gw)
        raises (SYNCHRONIZATION_ERROR,CANT_REMOVE_OBSERVER);
      // Remove the observer.
      // @@ TODO: We should raise something if the handle is invalid.
    };
};

#endif /* TAO_RTEC_EVENTCHANNELADMIN_IDL */